《Efficient Deep Learning Book》[EDL] Chapter 3 - Learning TechniquesRandomFlip("horizontal"), layers.RandomRotation(0.1), ]) def augfn(image, label): image = tf.expand_dims(image, 0) # Introduce a batch dimension image = augs(image, training=True) # Apply augmentation conveys the information that the person is going to the market. A version of this example could be a native english speaker’s response, “I go market”, to an elementary level english speaker. Although the efficiencies. The key takeaway for the reader from this section is that augmentation techniques can help to expand the datasets to reduce or eliminate the need for expensive data collection in data scarce situations0 码力 | 56 页 | 18.93 MB | 1 年前3
Lecture 1: Overviewor mail filter Personalized tutoring Discover new knowledge from large databases (data mining) Market basket analysis (e.g. diapers and beer) Medical information mining (e.g. migraines to calcium channel September 6, 2023 26 / 57 Supervised Regression Problems Predict tomorrow’s stock market price given current market conditions and other possible side information Predict the age of a viewer watching0 码力 | 57 页 | 2.41 MB | 1 年前3
QCon北京2018-《从键盘输入到神经网络--深度学习在彭博的应用》-李碧野Data Technologies Automation? Challenges – Scale of Financial Information Companies Market Types Speed To Market Problematic Files/Input Accuracy Modified from https://upload.wikimedia.org/wiki0 码力 | 64 页 | 13.45 MB | 1 年前3
亚马逊AWSAI Services OverviewInput 应用案例: Capital One “A highly scalable solution, it also offers potential to speed time to market for a new generation of voice and text interactions such as our recently launched Capital One skill0 码力 | 56 页 | 4.97 MB | 1 年前3
深度学习与PyTorch入门实战 - 09. 维度变换Tensor维度变换 主讲人:龙良曲 Operation ▪ View/reshape ▪ Squeeze/unsqueeze ▪ Transpose/t/permute ▪ Expand/repeat 2 View reshape ▪ Lost dim information 3 Flexible but prone to corrupt 4 Squeeze v.s. unsqueeze 28 28 Neg. Idx -4 -3 -2 -1 7 For example 8 squeeze 9 Expand / repeat ▪ Expand: broadcasting ▪ Repeat: memory copied 10 Expand/expand_as 11 repeat Memory touched 12 .t 13 Transpose 140 码力 | 16 页 | 1.66 MB | 1 年前3
深度学习与PyTorch入门实战 - 10. Broadcasting主讲人:龙良曲 Broadcasting https://blog.openai.com/generative-models/ ▪ Expand ▪ without copying data Key idea ▪ Insert 1 dim ahead ▪ Expand dims with size 1 to same size ▪ Feature maps: [4, 32, 14, 14] it broadcasting-able? ▪ Match from Last dim! ▪ If current dim=1, expand to same ▪ If either has no dim, insert one dim and expand to same ▪ otherwise, NOT broadcasting-able Situation 1: ▪ [4, 32 14, 14] Situation 3 ▪ [4, 32, 14, 14] ▪ [2, 32, 14, 14] ▪ Dim 0 has dim, can NOT insert and expand to same ▪ Dim 0 has distinct dim, NOT size 1 ▪ NOT broadcasting-able How to understand this behavior0 码力 | 12 页 | 551.84 KB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版202112算法的每个模块对于数据张量的格式有不同的逻辑要求,当现有的数据格式不满足算 法要求时,需要通过维度变换将数据调整为正确的格式。这就是维度变换的功能。 基本的维度变换操作函数包含了改变视图 reshape 操作、插入新维度 expand_dims 操 作、删除维度 squeeze 操作、交换维度 transpose 操作、复制数据 tile 操作等,下面将一一 介绍。 4.7.1 改变视图 在介绍改变视图 reshape x@w+b # 不同 shape 的张量直接相加 y 上述加法并没有发生逻辑错误,那么它是怎么实现的呢?这是因为它自动调用函数 x.expand(new_shape),将两者 shape 扩张为相同的[2,3],即上式可以等效为: y = x@w + b.expand([2,3]) # 手动扩展,并相加 也就是说,操作符+在遇到 shape 不一致的 2 个张量时,会隐式考虑将 2 个张量自动扩展到 Broadcasting 示意图 通过 x.expand(new_shape)函数可以显式地在逻辑上扩展数据形状,将现有 shape 扩张 为 new_shape,扩充后张量继续完成后续数学运算,可能触发 Broadcasting 机制,相对于昂 贵的 repeat 操作来说,expand 操作几乎是零消耗的,甚至用户都不需要显式调用 expand 操 作。图 4.8 的代码实现如下: In0 码力 | 439 页 | 29.91 MB | 1 年前3
Machine Learning Pytorch Tutorialx.shape torch.Size([2, 3]) 1 2 3 2 3 (dim = 0) Tensors – Common Operations ● Unsqueeze: expand a new dimension >>> x = torch.zeros([2, 3]) >>> x.shape torch.Size([2, 3]) >>> x = x.unsqueeze(1) as well PyTorch NumPy x.reshape / x.view x.reshape x.squeeze() x.squeeze() x.unsqueeze(1) np.expand_dims(x, 1) ref: https://github.com/wkentaro/pytorch-for-numpy-users Tensors – Device ● Tensors0 码力 | 48 页 | 584.86 KB | 1 年前3
Keras: 基于 Python 的深度学习库jpg' img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) 预训练模型 APPLICATIONS 159 x = preprocess_input(x) preds = model.predict(x) # decode jpg' img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) features = model.predict(x) 13.2.3 从 VGG19 的任意中间层中抽取特征 jpg' img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) 预训练模型 APPLICATIONS 160 block4_pool_features = model.predict(x)0 码力 | 257 页 | 1.19 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 6 - Advanced Learning Techniques - Technical Reviewlambda x: (preprocessor(x['description']), tf.expand_dims(x['label'], axis=-1))) test_ds = batched_test.map( lambda x: (preprocessor(x['description']), tf.expand_dims(x['label'], axis=-1))) Now we will0 码力 | 31 页 | 4.03 MB | 1 年前3
共 12 条
- 1
- 2













