def train_loop(): step = 0 ax = [] ay = [] plt.ion() PASS_NUM = n_epochs for pass_id in range(PASS_NUM): total_loss_pass = 0 for data in train_reader(): avg_loss_value, = exe.run( fluid.default_main_program(), feed= feeder.feed(data), fetch_list=[avg_loss]) total_loss_pass += avg_loss_value ax.append(pass_id) ay.append(total_loss_pass) plt.clf() plt.plot(ax, ay) plt.pause(0.01) plt.ioff() step += 1 display.clear_output(wait=True) fluid.io.save_inference_model(SAVE_DIRNAME, ['x'], [prediction], exe) train_loop()

时间: 2024-02-14 10:35:35 浏览: 29
这段代码定义了一个train_loop函数,用于训练模型。在函数内部,首先设置了迭代次数PASS_NUM和当前迭代次数pass_id,然后进入数据读取和训练的循环中。在每次循环中,通过train_reader函数读取一个mini-batch的训练数据,将数据送入计算图中进行前向计算和反向传播,得到平均损失值avg_loss_value。累计每个mini-batch的平均损失值,得到当前迭代次数下的总损失值total_loss_pass。将total_loss_pass和pass_id分别保存到ax和ay数组中,并使用matplotlib库将损失曲线实时显示在屏幕上。在训练完成后,使用fluid.io.save_inference_model函数将训练得到的模型保存到SAVE_DIRNAME目录中,以便后续的预测任务使用。请注意,这里的prediction是输出层的输出,即模型的预测结果。请问您还有其他问题吗?
相关问题

绘制训练集和测试集的真实值和预测值图像 train_predict_plot = np.empty_like(data_scaled) train_predict_plot[:, :] = np.nan train_predict_plot[time_steps:len(train_predict) + time_steps, :] = train_predict test_predict_plot = np.empty_like(data_scaled) test_predict_plot[:, :] = np.nan test_predict_plot[len(train_predict) + time_steps * 2 + 1:len(data_scaled) - 1, :] = test_predict plt.figure(figsize=(10, 6)) plt.plot(scaler.inverse_transform(data_scaled)) plt.plot(train_predict_plot) plt.plot(test_predict_plot) plt.legend(['True', 'Train Predict', 'Test Predict']) plt.xlabel('Time/h') plt.ylabel('kwh') plt.show(改写以上代码,使得训练集部分和测试集部分分别绘制在两张图上

下面是改写后的代码,将训练集和测试集的真实值和预测值分别绘制在两张图上: ``` train_predict_plot = np.empty_like(data_scaled) train_predict_plot[:, :] = np.nan train_predict_plot[time_steps:len(train_predict) + time_steps, :] = train_predict test_predict_plot = np.empty_like(data_scaled) test_predict_plot[:, :] = np.nan test_predict_plot[len(train_predict) + time_steps * 2 + 1:len(data_scaled) - 1, :] = test_predict # 绘制训练集部分真实值和预测值图像 plt.figure(figsize=(10, 6)) plt.plot(scaler.inverse_transform(data_scaled[:len(train_predict)])) plt.plot(train_predict_plot[:len(train_predict)]) plt.legend(['True', 'Train Predict']) plt.xlabel('Time/h') plt.ylabel('kwh') plt.title('Training Set') plt.show() # 绘制测试集部分真实值和预测值图像 plt.figure(figsize=(10, 6)) plt.plot(scaler.inverse_transform(data_scaled[len(train_predict) + time_steps * 2 + 1:])) plt.plot(test_predict_plot[len(train_predict) + time_steps * 2 + 1:]) plt.legend(['True', 'Test Predict']) plt.xlabel('Time/h') plt.ylabel('kwh') plt.title('Test Set') plt.show() ```

class RandomWalk(): def __init__(self,point_num=5000): self.point_num = point_num self.xval = [0] self.yval = [0] def fill_walk(self): while len(self.xval)<self.point_num: x_direction = choice([1,-1]) step_num = choice([0,1,2,3,4]) xstep = x_direction * step_num y_direction = choice([1,-1]) step_num = choice([0,1,2,3,4]) ystep = y_direction * step_num if xstep == 0 and ystep==0: continue x_next = self.xval[-1] + xstep y_next = self.yval[-1] + ystep self.xval.append(x_next) self.yval.append(y_next) rw = RandomWalk(50000) rw.fill_walk() point_numbers = list(range(rw.point_num())) plt.scatter(rw.x_val,rw.y_val,c=point_numbers,cmap=plt.cm.Blues,edgecolor = 'none',s=2) plt.scatter(0,0,c='green',edgecolors='none',s=100) plt.scatter(rw.x_val[-1],rw.y_val[-1],c='red',edgecolor='none',s=100) plt.axes().get_xaxis().set_visible(False) plt.axes().get_xaxis().set_yisible(False) plt.show()修改代码

以下是修改后的代码: ```python import matplotlib.pyplot as plt from random import choice class RandomWalk(): def __init__(self, point_num=5000): self.point_num = point_num self.x_val = [0] self.y_val = [0] def fill_walk(self): while len(self.x_val) < self.point_num: x_direction = choice([1, -1]) x_step = choice([0, 1, 2, 3, 4]) x_val = x_direction * x_step y_direction = choice([1, -1]) y_step = choice([0, 1, 2, 3, 4]) y_val = y_direction * y_step if x_val == 0 and y_val == 0: continue next_x = self.x_val[-1] + x_val next_y = self.y_val[-1] + y_val self.x_val.append(next_x) self.y_val.append(next_y) rw = RandomWalk(50000) rw.fill_walk() point_numbers = list(range(rw.point_num)) plt.scatter(rw.x_val, rw.y_val, c=point_numbers, cmap=plt.cm.Blues, edgecolor='none', s=2) plt.scatter(0, 0, c='green', edgecolors='none', s=100) plt.scatter(rw.x_val[-1], rw.y_val[-1], c='red', edgecolor='none', s=100) plt.axes().get_xaxis().set_visible(False) plt.axes().get_yaxis().set_visible(False) plt.show() ``` 主要的修改包括: 1. `xval` 和 `yval` 改为 `x_val` 和 `y_val`,以符合 Python 的命名规范。 2. `rw.point_num()` 改为 `rw.point_num`,因为 `point_num` 是一个属性而不是方法。 3. `plt.axes().get_xaxis().set_yisible(False)` 改为 `plt.axes().get_yaxis().set_visible(False)`,因为原来的代码中打错了单词。

相关推荐

下面的这段python代码,哪里有错误,修改一下:import numpy as np import matplotlib.pyplot as plt import pandas as pd import torch import torch.nn as nn from torch.autograd import Variable from sklearn.preprocessing import MinMaxScaler training_set = pd.read_csv('CX2-36_1971.csv') training_set = training_set.iloc[:, 1:2].values def sliding_windows(data, seq_length): x = [] y = [] for i in range(len(data) - seq_length): _x = data[i:(i + seq_length)] _y = data[i + seq_length] x.append(_x) y.append(_y) return np.array(x), np.array(y) sc = MinMaxScaler() training_data = sc.fit_transform(training_set) seq_length = 1 x, y = sliding_windows(training_data, seq_length) train_size = int(len(y) * 0.8) test_size = len(y) - train_size dataX = Variable(torch.Tensor(np.array(x))) dataY = Variable(torch.Tensor(np.array(y))) trainX = Variable(torch.Tensor(np.array(x[1:train_size]))) trainY = Variable(torch.Tensor(np.array(y[1:train_size]))) testX = Variable(torch.Tensor(np.array(x[train_size:len(x)]))) testY = Variable(torch.Tensor(np.array(y[train_size:len(y)]))) class LSTM(nn.Module): def __init__(self, num_classes, input_size, hidden_size, num_layers): super(LSTM, self).__init__() self.num_classes = num_classes self.num_layers = num_layers self.input_size = input_size self.hidden_size = hidden_size self.seq_length = seq_length self.lstm = nn.LSTM(input_size=input_size, hidden_size=hidden_size, num_layers=num_layers, batch_first=True) self.fc = nn.Linear(hidden_size, num_classes) def forward(self, x): h_0 = Variable(torch.zeros( self.num_layers, x.size(0), self.hidden_size)) c_0 = Variable(torch.zeros( self.num_layers, x.size(0), self.hidden_size)) # Propagate input through LSTM ula, (h_out, _) = self.lstm(x, (h_0, c_0)) h_out = h_out.view(-1, self.hidden_size) out = self.fc(h_out) return out num_epochs = 2000 learning_rate = 0.001 input_size = 1 hidden_size = 2 num_layers = 1 num_classes = 1 lstm = LSTM(num_classes, input_size, hidden_size, num_layers) criterion = torch.nn.MSELoss() # mean-squared error for regression optimizer = torch.optim.Adam(lstm.parameters(), lr=learning_rate) # optimizer = torch.optim.SGD(lstm.parameters(), lr=learning_rate) runn = 10 Y_predict = np.zeros((runn, len(dataY))) # Train the model for i in range(runn): print('Run: ' + str(i + 1)) for epoch in range(num_epochs): outputs = lstm(trainX) optimizer.zero_grad() # obtain the loss function loss = criterion(outputs, trainY) loss.backward() optimizer.step() if epoch % 100 == 0: print("Epoch: %d, loss: %1.5f" % (epoch, loss.item())) lstm.eval() train_predict = lstm(dataX) data_predict = train_predict.data.numpy() dataY_plot = dataY.data.numpy() data_predict = sc.inverse_transform(data_predict) dataY_plot = sc.inverse_transform(dataY_plot) Y_predict[i,:] = np.transpose(np.array(data_predict)) Y_Predict = np.mean(np.array(Y_predict)) Y_Predict_T = np.transpose(np.array(Y_Predict))

import pandas as pd import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense data = pd.read_csv('车辆:274序:4结果数据.csv') x = data[['车头间距', '原车道前车速度']].values y = data['本车速度'].values train_size = int(len(x) * 0.7) test_size = len(x) - train_size x_train, x_test = x[0:train_size,:], x[train_size:len(x),:] y_train, y_test = y[0:train_size], y[train_size:len(y)] from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler(feature_range=(0, 1)) x_train = scaler.fit_transform(x_train) x_test = scaler.transform(x_test) model = Sequential() model.add(LSTM(50, input_shape=(2, 1))) model.add(Dense(1)) model.compile(loss='mean_squared_error', optimizer='adam') history = model.fit(x_train.reshape(-1, 2, 1), y_train, epochs=100, batch_size=32, validation_data=(x_test.reshape(-1, 2, 1), y_test)) plt.plot(history.history['loss']) plt.plot(history.history['val_loss']) plt.title('Model loss') plt.ylabel('Loss') plt.xlabel('Epoch') plt.legend(['Train', 'Test'], loc='upper right') plt.show() train_predict = model.predict(x_train.reshape(-1, 2, 1)) test_predict = model.predict(x_test.reshape(-1, 2, 1)) train_predict = scaler.inverse_transform(train_predict) train_predict = train_predict.reshape(-1) # 将结果变为一维数组 y_train = scaler.inverse_transform(y_train.reshape(-1, 1)).reshape(-1) # 将结果变为一维数组 test_predict = scaler.inverse_transform(test_predict) y_test = scaler.inverse_transform([y_test]) plt.plot(y_train[0], label='train') plt.plot(train_predict[:,0], label='train predict') plt.plot(y_test[0], label='test') plt.plot(test_predict[:,0], label='test predict') plt.legend() plt.show()报错Traceback (most recent call last): File "C:\Users\马斌\Desktop\NGSIM_data_processing\80s\lstmtest.py", line 42, in <module> train_predict = scaler.inverse_transform(train_predict) File "D:\python\python3.9.5\pythonProject\venv\lib\site-packages\sklearn\preprocessing\_data.py", line 541, in inverse_transform X -= self.min_ ValueError: non-broadcastable output operand with shape (611,1) doesn't match the broadcast shape (611,2)

帮我把下面这个代码从TensorFlow改成pytorch import tensorflow as tf import os import numpy as np import matplotlib.pyplot as plt os.environ["CUDA_VISIBLE_DEVICES"] = "0" base_dir = 'E:/direction/datasetsall/' train_dir = os.path.join(base_dir, 'train_img/') validation_dir = os.path.join(base_dir, 'val_img/') train_cats_dir = os.path.join(train_dir, 'down') train_dogs_dir = os.path.join(train_dir, 'up') validation_cats_dir = os.path.join(validation_dir, 'down') validation_dogs_dir = os.path.join(validation_dir, 'up') batch_size = 64 epochs = 50 IMG_HEIGHT = 128 IMG_WIDTH = 128 num_cats_tr = len(os.listdir(train_cats_dir)) num_dogs_tr = len(os.listdir(train_dogs_dir)) num_cats_val = len(os.listdir(validation_cats_dir)) num_dogs_val = len(os.listdir(validation_dogs_dir)) total_train = num_cats_tr + num_dogs_tr total_val = num_cats_val + num_dogs_val train_image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1. / 255) validation_image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1. / 255) train_data_gen = train_image_generator.flow_from_directory(batch_size=batch_size, directory=train_dir, shuffle=True, target_size=(IMG_HEIGHT, IMG_WIDTH), class_mode='categorical') val_data_gen = validation_image_generator.flow_from_directory(batch_size=batch_size, directory=validation_dir, target_size=(IMG_HEIGHT, IMG_WIDTH), class_mode='categorical') sample_training_images, _ = next(train_data_gen) model = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(16, 3, padding='same', activation='relu', input_shape=(IMG_HEIGHT, IMG_WIDTH, 3)), tf.keras.layers.MaxPooling2D(), tf.keras.layers.Conv2D(32, 3, padding='same', activation='relu'), tf.keras.layers.MaxPooling2D(), tf.keras.layers.Conv2D(64, 3, padding='same', activation='relu'), tf.keras.layers.MaxPooling2D(), tf.keras.layers.Flatten(), tf.keras.layers.Dense(256, activation='relu'), tf.keras.layers.Dense(2, activation='softmax') ]) model.compile(optimizer='adam', loss=tf.keras.losses.BinaryCrossentropy(from_logits=True), metrics=['accuracy']) model.summary() history = model.fit_generator( train_data_gen, steps_per_epoch=total_train // batch_size, epochs=epochs, validation_data=val_data_gen, validation_steps=total_val // batch_size ) # 可视化训练结果 acc = history.history['accuracy'] val_acc = history.history['val_accuracy'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs_range = range(epochs) model.save("./model/timo_classification_128_maxPool2D_dense256.h5")

以下代码有什么错误,怎么修改: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from PIL import Image import matplotlib.pyplot as plt import input_data import model import numpy as np import xlsxwriter num_threads = 4 def evaluate_one_image(): workbook = xlsxwriter.Workbook('formatting.xlsx') worksheet = workbook.add_worksheet('My Worksheet') with tf.Graph().as_default(): BATCH_SIZE = 1 N_CLASSES = 4 image = tf.cast(image_array, tf.float32) image = tf.image.per_image_standardization(image) image = tf.reshape(image, [1, 208, 208, 3]) logit = model.cnn_inference(image, BATCH_SIZE, N_CLASSES) logit = tf.nn.softmax(logit) x = tf.placeholder(tf.float32, shape=[208, 208, 3]) logs_train_dir = 'log/' saver = tf.train.Saver() with tf.Session() as sess: print("从指定路径中加载模型...") ckpt = tf.train.get_checkpoint_state(logs_train_dir) if ckpt and ckpt.model_checkpoint_path: global_step = ckpt.model_checkpoint_path.split('/')[-1].split('-')[-1] saver.restore(sess, ckpt.model_checkpoint_path) print('模型加载成功, 训练的步数为: %s' % global_step) else: print('模型加载失败,checkpoint文件没找到!') prediction = sess.run(logit, feed_dict={x: image_array}) max_index = np.argmax(prediction) workbook.close() def evaluate_images(test_img): coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord) for index,img in enumerate(test_img): image = Image.open(img) image = image.resize([208, 208]) image_array = np.array(image) tf.compat.v1.threading.Thread(target=evaluate_one_image, args=(image_array, index)).start() coord.request_stop() coord.join(threads) if __name__ == '__main__': test_dir = 'data/test/' import glob import xlwt test_img = glob.glob(test_dir + '*.jpg') evaluate_images(test_img)

最新推荐

recommend-type

1719378276792.jpg

1719378276792.jpg
recommend-type

054ssm-jsp-mysql旅游景点线路网站.zip(可运行源码+数据库文件+文档)

本系统采用了jsp技术,将所有业务模块采用以浏览器交互的模式,选择MySQL作为系统的数据库,开发工具选择eclipse来进行系统的设计。基本实现了旅游网站应有的主要功能模块,本系统有管理员、和会员,管理员权限如下:个人中心、会员管理、景点分类管理、旅游景点管理、旅游线路管理、系统管理;会员权限如下:个人中心、旅游景点管理、旅游线路管理、我的收藏管理等操作。 对系统进行测试后,改善了程序逻辑和代码。同时确保系统中所有的程序都能正常运行,所有的功能都能操作,并且该系统有很好的操作体验,实现了对于景点和会员双赢。 关键词:旅游网站;jsp;Mysql;
recommend-type

基于单片机的篮球赛计时计分器.doc

基于单片机的篮球赛计时计分器.doc
recommend-type

京瓷TASKalfa系列维修手册:安全与操作指南

"该资源是一份针对京瓷TASKalfa系列多款型号打印机的维修手册,包括TASKalfa 2020/2021/2057,TASKalfa 2220/2221,TASKalfa 2320/2321/2358,以及DP-480,DU-480,PF-480等设备。手册标注为机密,仅供授权的京瓷工程师使用,强调不得泄露内容。手册内包含了重要的安全注意事项,提醒维修人员在处理电池时要防止爆炸风险,并且应按照当地法规处理废旧电池。此外,手册还详细区分了不同型号产品的打印速度,如TASKalfa 2020/2021/2057的打印速度为20张/分钟,其他型号则分别对应不同的打印速度。手册还包括修订记录,以确保信息的最新和准确性。" 本文档详尽阐述了京瓷TASKalfa系列多功能一体机的维修指南,适用于多种型号,包括速度各异的打印设备。手册中的安全警告部分尤为重要,旨在保护维修人员、用户以及设备的安全。维修人员在操作前必须熟知这些警告,以避免潜在的危险,如不当更换电池可能导致的爆炸风险。同时,手册还强调了废旧电池的合法和安全处理方法,提醒维修人员遵守地方固体废弃物法规。 手册的结构清晰,有专门的修订记录,这表明手册会随着设备的更新和技术的改进不断得到完善。维修人员可以依靠这份手册获取最新的维修信息和操作指南,确保设备的正常运行和维护。 此外,手册中对不同型号的打印速度进行了明确的区分,这对于诊断问题和优化设备性能至关重要。例如,TASKalfa 2020/2021/2057系列的打印速度为20张/分钟,而TASKalfa 2220/2221和2320/2321/2358系列则分别具有稍快的打印速率。这些信息对于识别设备性能差异和优化工作流程非常有用。 总体而言,这份维修手册是京瓷TASKalfa系列设备维修保养的重要参考资料,不仅提供了详细的操作指导,还强调了安全性和合规性,对于授权的维修工程师来说是不可或缺的工具。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

【进阶】入侵检测系统简介

![【进阶】入侵检测系统简介](http://www.csreviews.cn/wp-content/uploads/2020/04/ce5d97858653b8f239734eb28ae43f8.png) # 1. 入侵检测系统概述** 入侵检测系统(IDS)是一种网络安全工具,用于检测和预防未经授权的访问、滥用、异常或违反安全策略的行为。IDS通过监控网络流量、系统日志和系统活动来识别潜在的威胁,并向管理员发出警报。 IDS可以分为两大类:基于网络的IDS(NIDS)和基于主机的IDS(HIDS)。NIDS监控网络流量,而HIDS监控单个主机的活动。IDS通常使用签名检测、异常检测和行
recommend-type

轨道障碍物智能识别系统开发

轨道障碍物智能识别系统是一种结合了计算机视觉、人工智能和机器学习技术的系统,主要用于监控和管理铁路、航空或航天器的运行安全。它的主要任务是实时检测和分析轨道上的潜在障碍物,如行人、车辆、物体碎片等,以防止这些障碍物对飞行或行驶路径造成威胁。 开发这样的系统主要包括以下几个步骤: 1. **数据收集**:使用高分辨率摄像头、雷达或激光雷达等设备获取轨道周围的实时视频或数据。 2. **图像处理**:对收集到的图像进行预处理,包括去噪、增强和分割,以便更好地提取有用信息。 3. **特征提取**:利用深度学习模型(如卷积神经网络)提取障碍物的特征,如形状、颜色和运动模式。 4. **目标
recommend-type

小波变换在视频压缩中的应用

"多媒体通信技术视频信息压缩与处理(共17张PPT).pptx" 多媒体通信技术涉及的关键领域之一是视频信息压缩与处理,这在现代数字化社会中至关重要,尤其是在传输和存储大量视频数据时。本资料通过17张PPT详细介绍了这一主题,特别是聚焦于小波变换编码和分形编码两种新型的图像压缩技术。 4.5.1 小波变换编码是针对宽带图像数据压缩的一种高效方法。与离散余弦变换(DCT)相比,小波变换能够更好地适应具有复杂结构和高频细节的图像。DCT对于窄带图像信号效果良好,其变换系数主要集中在低频部分,但对于宽带图像,DCT的系数矩阵中的非零系数分布较广,压缩效率相对较低。小波变换则允许在频率上自由伸缩,能够更精确地捕捉图像的局部特征,因此在压缩宽带图像时表现出更高的效率。 小波变换与傅里叶变换有本质的区别。傅里叶变换依赖于一组固定频率的正弦波来表示信号,而小波分析则是通过母小波的不同移位和缩放来表示信号,这种方法对非平稳和局部特征的信号描述更为精确。小波变换的优势在于同时提供了时间和频率域的局部信息,而傅里叶变换只提供频率域信息,却丢失了时间信息的局部化。 在实际应用中,小波变换常常采用八带分解等子带编码方法,将低频部分细化,高频部分则根据需要进行不同程度的分解,以此达到理想的压缩效果。通过改变小波的平移和缩放,可以获取不同分辨率的图像,从而实现按需的图像质量与压缩率的平衡。 4.5.2 分形编码是另一种有效的图像压缩技术,特别适用于处理不规则和自相似的图像特征。分形理论源自自然界的复杂形态,如山脉、云彩和生物组织,它们在不同尺度上表现出相似的结构。通过分形编码,可以将这些复杂的形状和纹理用较少的数据来表示,从而实现高压缩比。分形编码利用了图像中的分形特性,将其转化为分形块,然后进行编码,这在处理具有丰富细节和不规则边缘的图像时尤其有效。 小波变换和分形编码都是多媒体通信技术中视频信息压缩的重要手段,它们分别以不同的方式处理图像数据,旨在减少存储和传输的需求,同时保持图像的质量。这两种技术在现代图像处理、视频编码标准(如JPEG2000)中都有广泛应用。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

【进阶】Python高级加密库cryptography

![【进阶】Python高级加密库cryptography](https://img-blog.csdnimg.cn/20191105183454149.jpg) # 2.1 AES加密算法 ### 2.1.1 AES加密原理 AES(高级加密标准)是一种对称块密码,由美国国家标准与技术研究院(NIST)于2001年发布。它是一种分组密码,这意味着它一次处理固定大小的数据块(通常为128位)。AES使用密钥长度为128、192或256位的迭代密码,称为Rijndael密码。 Rijndael密码基于以下基本操作: - 字节替换:将每个字节替换为S盒中的另一个字节。 - 行移位:将每一行