 Keras: 基于 Python 的深度学习库ImageDataGenerator(featurewise_center=False, samplewise_center=False, featurewise_std_normalization=False, samplewise_std_normalization=False, zca_whitening=False, zca_epsilon=1e-06, rotation_range=0 布尔值。将输入数据的均值设置为 0,逐特征进行。 • samplewise_center: 布尔值。将每个样本的均值设置为 0。 • featurewise_std_normalization: Boolean. 布尔值。将输入除以数据标准差,逐特征进行。 • samplewise_std_normalization: 布尔值。将每个输入除以其标准差。 • zca_epsilon: ZCA 白化的 epsilon 值,默认为 to_categorical(y_test, num_classes) datagen = ImageDataGenerator( featurewise_center=True, featurewise_std_normalization=True, rotation_range=20, width_shift_range=0.2, height_shift_range=0.2, horizontal_flip=True)0 码力 | 257 页 | 1.19 MB | 1 年前3 Keras: 基于 Python 的深度学习库ImageDataGenerator(featurewise_center=False, samplewise_center=False, featurewise_std_normalization=False, samplewise_std_normalization=False, zca_whitening=False, zca_epsilon=1e-06, rotation_range=0 布尔值。将输入数据的均值设置为 0,逐特征进行。 • samplewise_center: 布尔值。将每个样本的均值设置为 0。 • featurewise_std_normalization: Boolean. 布尔值。将输入除以数据标准差,逐特征进行。 • samplewise_std_normalization: 布尔值。将每个输入除以其标准差。 • zca_epsilon: ZCA 白化的 epsilon 值,默认为 to_categorical(y_test, num_classes) datagen = ImageDataGenerator( featurewise_center=True, featurewise_std_normalization=True, rotation_range=20, width_shift_range=0.2, height_shift_range=0.2, horizontal_flip=True)0 码力 | 257 页 | 1.19 MB | 1 年前3
 动手学深度学习 v2.0sigma) for mu, sigma in params], xlabel='x', ylabel='p(x)', figsize=(4.5, 2.5), legend=[f'mean {mu}, std {sigma}' for mu, sigma in params]) 3.1. 线性回归 91 就像我们所看到的,改变均值会产生沿x轴的偏移,增加方差将会分散分布、降低其峰值。 均方误差损失 Flatten(), nn.Linear(784, 10)) def init_weights(m): if type(m) == nn.Linear: nn.init.normal_(m.weight, std=0.01) net.apply(init_weights); 3.7.2 重新审视Softmax的实现 在前面 3.6节的例子中,我们计算了模型的输出,然后将此输出送入交叉熵损失。从数学上讲,这是一件完全 ReLU(), nn.Linear(256, 10)) def init_weights(m): if type(m) == nn.Linear: nn.init.normal_(m.weight, std=0.01) net.apply(init_weights); 训练过程的实现与我们实现softmax回归时完全相同,这种模块化设计使我们能够将与模型架构有关的内容 独立出来。 batch_size0 码力 | 797 页 | 29.45 MB | 1 年前3 动手学深度学习 v2.0sigma) for mu, sigma in params], xlabel='x', ylabel='p(x)', figsize=(4.5, 2.5), legend=[f'mean {mu}, std {sigma}' for mu, sigma in params]) 3.1. 线性回归 91 就像我们所看到的,改变均值会产生沿x轴的偏移,增加方差将会分散分布、降低其峰值。 均方误差损失 Flatten(), nn.Linear(784, 10)) def init_weights(m): if type(m) == nn.Linear: nn.init.normal_(m.weight, std=0.01) net.apply(init_weights); 3.7.2 重新审视Softmax的实现 在前面 3.6节的例子中,我们计算了模型的输出,然后将此输出送入交叉熵损失。从数学上讲,这是一件完全 ReLU(), nn.Linear(256, 10)) def init_weights(m): if type(m) == nn.Linear: nn.init.normal_(m.weight, std=0.01) net.apply(init_weights); 训练过程的实现与我们实现softmax回归时完全相同,这种模块化设计使我们能够将与模型架构有关的内容 独立出来。 batch_size0 码力 | 797 页 | 29.45 MB | 1 年前3
 深度学习与PyTorch入门实战 - 07. 创建Tensordefault type rand/rand_like, randint ▪ [0, 1] ▪ [min, max) ▪ *_like randn ▪ N(0, 1) ▪ N(u, std) full arange/range linspace/logspace Ones/zeros/eye Ones/zeros/eye randperm ▪ random.shuffle0 码力 | 16 页 | 1.43 MB | 1 年前3 深度学习与PyTorch入门实战 - 07. 创建Tensordefault type rand/rand_like, randint ▪ [0, 1] ▪ [min, max) ▪ *_like randn ▪ N(0, 1) ▪ N(u, std) full arange/range linspace/logspace Ones/zeros/eye Ones/zeros/eye randperm ▪ random.shuffle0 码力 | 16 页 | 1.43 MB | 1 年前3
 深度学习与PyTorch入门实战 - 63. 迁移学习-自定义数据集实战Image Resize ▪ 224x224 for ResNet18 ▪ Data Argumentation ▪ Rotate ▪ Crop ▪ Normalize ▪ Mean, std ▪ ToTensor Step2.build model ▪ Inherit from base class ▪ Define forward graph Step3.Train and0 码力 | 16 页 | 719.15 KB | 1 年前3 深度学习与PyTorch入门实战 - 63. 迁移学习-自定义数据集实战Image Resize ▪ 224x224 for ResNet18 ▪ Data Argumentation ▪ Rotate ▪ Crop ▪ Normalize ▪ Mean, std ▪ ToTensor Step2.build model ▪ Inherit from base class ▪ Define forward graph Step3.Train and0 码力 | 16 页 | 719.15 KB | 1 年前3
 机器学习课程-温州大学-05深度学习-深度学习实践随机旋转 transforms.ToTensor(), # 转换为Tensor类型 transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) # 标准化 ]) # 加载图像数据 img = Image.open('image.jpg').convert('RGB') # 对图像进行数据增强0 码力 | 19 页 | 1.09 MB | 1 年前3 机器学习课程-温州大学-05深度学习-深度学习实践随机旋转 transforms.ToTensor(), # 转换为Tensor类型 transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) # 标准化 ]) # 加载图像数据 img = Image.open('image.jpg').convert('RGB') # 对图像进行数据增强0 码力 | 19 页 | 1.09 MB | 1 年前3
 Experiment 1: Linear Regressionstandard deviations and set their means to zero. In Matlab/Octave, this can be executed with sigma = std (x ) ; mu = mean(x ) ; x ( : , 2 ) = ( x ( : , 2 ) − mu( 2 ) ) . / sigma ( 2 ) ; x ( : , 3 ) = ( x0 码力 | 7 页 | 428.11 KB | 1 年前3 Experiment 1: Linear Regressionstandard deviations and set their means to zero. In Matlab/Octave, this can be executed with sigma = std (x ) ; mu = mean(x ) ; x ( : , 2 ) = ( x ( : , 2 ) − mu( 2 ) ) . / sigma ( 2 ) ; x ( : , 3 ) = ( x0 码力 | 7 页 | 428.11 KB | 1 年前3
 机器学习课程-温州大学-numpy使用总结np.random.randint(0,10,size=(4,5)) > np.sum(a) 96 函数名 功能 sum 求和 average 加权平均数 var 方差 mean 期望 std 标准差 product 连乘积 37 求和,平均值,方差 a -------------- [[6, 3, 7, 4, 6], [9,0 码力 | 49 页 | 1.52 MB | 1 年前3 机器学习课程-温州大学-numpy使用总结np.random.randint(0,10,size=(4,5)) > np.sum(a) 96 函数名 功能 sum 求和 average 加权平均数 var 方差 mean 期望 std 标准差 product 连乘积 37 求和,平均值,方差 a -------------- [[6, 3, 7, 4, 6], [9,0 码力 | 49 页 | 1.52 MB | 1 年前3
 【PyTorch深度学习-龙龙老师】-测试版202112stddev2)分布的张量。例如,创建均值为 1,标准差为 0.5 的正态分布: In [34]: a = torch.empty(2,3) # 创建 2 行 3 列的未初始化张量 a.normal_(mean=1,std=0.5) # 采用均值为 1,标注差为 0.5 的正态分布初始化 Out[34]: tensor([[1.6049, 1.1765, 0.6371], [1.2312, 转置 # 标准化数据 def norm(x): # 减去每个字段的均值,并除以标准差 return (x - train_stats['mean']) / train_stats['std'] normed_train_data = norm(train_dataset) # 标准化训练集 normed_test_data = norm(test_dataset) # 标准化测试集 eps = torch.randn(log_var.shape) # 获得标注差 std = torch.exp(log_var*0.5) # 采样隐向量 z z = mu + std * eps return z 12.5.3 网络训练 网络固定训练 100 个 Epoch,每次从0 码力 | 439 页 | 29.91 MB | 1 年前3 【PyTorch深度学习-龙龙老师】-测试版202112stddev2)分布的张量。例如,创建均值为 1,标准差为 0.5 的正态分布: In [34]: a = torch.empty(2,3) # 创建 2 行 3 列的未初始化张量 a.normal_(mean=1,std=0.5) # 采用均值为 1,标注差为 0.5 的正态分布初始化 Out[34]: tensor([[1.6049, 1.1765, 0.6371], [1.2312, 转置 # 标准化数据 def norm(x): # 减去每个字段的均值,并除以标准差 return (x - train_stats['mean']) / train_stats['std'] normed_train_data = norm(train_dataset) # 标准化训练集 normed_test_data = norm(test_dataset) # 标准化测试集 eps = torch.randn(log_var.shape) # 获得标注差 std = torch.exp(log_var*0.5) # 采样隐向量 z z = mu + std * eps return z 12.5.3 网络训练 网络固定训练 100 个 Epoch,每次从0 码力 | 439 页 | 29.91 MB | 1 年前3
 《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression TechniquesIt supports vector operations which operate on a vector (or a batch) of x variables (vectorized execution) instead of one variable at a time. Although it is possible to work without it, you would have to applications which frequently operate on batches of data. Using vectorized operations also speeds up the execution (and this book is about efficiency, after all!). We highly recommend learning and becoming familiar0 码力 | 33 页 | 1.96 MB | 1 年前3 《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression TechniquesIt supports vector operations which operate on a vector (or a batch) of x variables (vectorized execution) instead of one variable at a time. Although it is possible to work without it, you would have to applications which frequently operate on batches of data. Using vectorized operations also speeds up the execution (and this book is about efficiency, after all!). We highly recommend learning and becoming familiar0 码力 | 33 页 | 1.96 MB | 1 年前3
 《TensorFlow 2项目进阶实战》1-基础理论篇:TensorFlow 2设计思想keras:分布式和高性能的 Keras • 构建和训练模型的高层次 API • API 完全兼容原生 Keras • 支持保存和加载 TensorFlow SavedModel • 支持 Eager Execution • 支持分布式训练 tf.data:功能强大的数据管理模块 支持多种数据处理 图像解码 Shuffle py_function 重采样 支持多种数据格式 图像文件 文本文件 CSV0 码力 | 40 页 | 9.01 MB | 1 年前3 《TensorFlow 2项目进阶实战》1-基础理论篇:TensorFlow 2设计思想keras:分布式和高性能的 Keras • 构建和训练模型的高层次 API • API 完全兼容原生 Keras • 支持保存和加载 TensorFlow SavedModel • 支持 Eager Execution • 支持分布式训练 tf.data:功能强大的数据管理模块 支持多种数据处理 图像解码 Shuffle py_function 重采样 支持多种数据格式 图像文件 文本文件 CSV0 码力 | 40 页 | 9.01 MB | 1 年前3
共 16 条
- 1
- 2













