deep-learning

What does the copy_initial_weights documentation mean in the higher library for Pytorch?

[亡魂溺海] 提交于 2020-06-23 05:44:26
问题 I was trying to use the higher library for meta-learning and I was having issues understanding what the copy_initial_weights mean. The docs say: copy_initial_weights – if true, the weights of the patched module are copied to form the initial weights of the patched module, and thus are not part of the gradient tape when unrolling the patched module. If this is set to False, the actual module weights will be the initial weights of the patched module. This is useful when doing MAML, for example.

What does the copy_initial_weights documentation mean in the higher library for Pytorch?

冷暖自知 提交于 2020-06-23 05:44:20
问题 I was trying to use the higher library for meta-learning and I was having issues understanding what the copy_initial_weights mean. The docs say: copy_initial_weights – if true, the weights of the patched module are copied to form the initial weights of the patched module, and thus are not part of the gradient tape when unrolling the patched module. If this is set to False, the actual module weights will be the initial weights of the patched module. This is useful when doing MAML, for example.

How to modify the Imagenet Caffe Model?

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-22 08:12:25
问题 I would like to modify the ImageNet caffe model as described bellow: As the input channel number for temporal nets is different from that of spatial nets (20 vs. 3), we average the ImageNet model filters of first layer across the channel, and then copy the average results 20 times as the initialization of temporal nets. My question is how can I achive the above results? How can I open the caffe model to be able to do those changes to it? I read the net surgery tutorial but it doesn't cover

How to solve error: no match between expected input batch size and target batch size in PyTorch?

别来无恙 提交于 2020-06-17 14:18:06
问题 I attempting to create a logistic model on CIFAR10 dataset by PyTorch. However I am getting an error: ValueError: Expected input batch_size (900) to match target batch_size (300). What I think is happening is that 3*100 is 300. So may be the 3 axis of the RGB image is doing that but I cant figure how to solve. These are my hyperparameters. batch_size = 100 learning_rate = 0.001 # Other constants input_size = 32*32 num_classes = 10 Here I divide my data into train, validation and test data.

Multi class classification using InceptionV3,VGG16 with 101 classes very low accuracy

风流意气都作罢 提交于 2020-06-17 09:59:12
问题 I am trying to build a food classification model with 101 classes. The dataset has 1000 image for each class. The accuracy of the model which I trained is coming less than 6%. I have tried implementing NASNet and VGG16 with imagenet weights but the accuracy did not increase. I have tried using Adam optimizer with or without amsgrad. I have also tried to change the learning rate to both 0.01 and 0.0001 but still, accuracy remains in the single-digit.Please suggest the methods to increase the

Multi class classification using InceptionV3,VGG16 with 101 classes very low accuracy

独自空忆成欢 提交于 2020-06-17 09:59:06
问题 I am trying to build a food classification model with 101 classes. The dataset has 1000 image for each class. The accuracy of the model which I trained is coming less than 6%. I have tried implementing NASNet and VGG16 with imagenet weights but the accuracy did not increase. I have tried using Adam optimizer with or without amsgrad. I have also tried to change the learning rate to both 0.01 and 0.0001 but still, accuracy remains in the single-digit.Please suggest the methods to increase the

Keras TypeError: Expected float32, got <tf.Tensor ..>of type 'Tensor' instead

≡放荡痞女 提交于 2020-06-17 09:12:29
问题 I have a Keras model which gives me error TypeError: Expected float32, got <tf.Tensor 'recommender_dnn_25/strided_slice_5:0' shape=(None, 1) dtype=float32> of type 'Tensor' instead. To my keras model, I am sending train/validation data of type numpy.ndarray . This is from movielens dataset and the values are movie_id , user_id , zip_code , age , gender . A sample row below: x_train[0] array(['195', '241', 415, 3, 1], dtype=object) The 1st two inputs are trained to an embedding along with the

Keras TypeError: Expected float32, got <tf.Tensor ..>of type 'Tensor' instead

末鹿安然 提交于 2020-06-17 09:10:26
问题 I have a Keras model which gives me error TypeError: Expected float32, got <tf.Tensor 'recommender_dnn_25/strided_slice_5:0' shape=(None, 1) dtype=float32> of type 'Tensor' instead. To my keras model, I am sending train/validation data of type numpy.ndarray . This is from movielens dataset and the values are movie_id , user_id , zip_code , age , gender . A sample row below: x_train[0] array(['195', '241', 415, 3, 1], dtype=object) The 1st two inputs are trained to an embedding along with the

Building CNN + LSTM in Keras for a regression problem. What are proper shapes?

浪子不回头ぞ 提交于 2020-06-17 00:02:34
问题 I am working on a regression problem where I feed a set of spectograms to CNN + LSTM - architecture in keras. My data is shaped as (n_samples, width, height, n_channels) . The question I have how to properly connect the CNN to the LSTM layer. The data needs to be reshaped in some way when the convolution is passed to the LSTM. There are several ideas, such as use of TimeDistributed -wrapper in combination with reshaping but I could not manage to make it work. . height = 256 width = 256 n

Forward vs reverse mode differentiation - Pytorch

一曲冷凌霜 提交于 2020-06-16 04:09:31
问题 In the first example of Learning PyTorch with Examples, the author demonstrates how to create a neural network with numpy. Their code is pasted below for convenience: # from: https://pytorch.org/tutorials/beginner/pytorch_with_examples.html # -*- coding: utf-8 -*- import numpy as np # N is batch size; D_in is input dimension; # H is hidden dimension; D_out is output dimension. N, D_in, H, D_out = 64, 1000, 100, 10 # Create random input and output data x = np.random.randn(N, D_in) y = np