deep-learning

Using sample_weight in Keras for sequence labelling

旧巷老猫 提交于 2020-05-09 19:25:08
问题 I am working on a sequential labeling problem with unbalanced classes and I would like to use sample_weight to resolve the unbalance issue. Basically if I train the model for about 10 epochs, I get great results. If I train for more epochs, val_loss keeps dropping, but I get worse results. I'm guessing the model just detects more of the dominant class to the detriment of the smaller classes. The model has two inputs, for word embeddings and character embeddings, and the input is one of 7

Hyperparameter optimization for Pytorch model

谁说我不能喝 提交于 2020-05-09 18:11:25
问题 What is the best way to perform hyperparameter optimization for a Pytorch model? Implement e.g. Random Search myself? Use Skicit Learn? Or is there anything else I am not aware of? 回答1: Many researchers use RayTune. It's a scalable hyperparameter tuning framework, specifically for deep learning. You can easily use it with any deep learning framework (2 lines of code below), and it provides most state-of-the-art algorithms, including HyperBand, Population-based Training, Bayesian Optimization,

Dropout with densely connected layer

我的梦境 提交于 2020-05-09 06:13:02
问题 Iam using a densenet model for one of my projects and have some difficulties using regularization. Without any regularization, both validation and training loss (MSE) decrease. The training loss drops faster though, resulting in some overfitting of the final model. So I decided to use dropout to avoid overfitting. When using Dropout, both validation and training loss decrease to about 0.13 during the first epoch and remain constant for about 10 epochs. After that both loss functions decrease

Dropout with densely connected layer

丶灬走出姿态 提交于 2020-05-09 06:12:00
问题 Iam using a densenet model for one of my projects and have some difficulties using regularization. Without any regularization, both validation and training loss (MSE) decrease. The training loss drops faster though, resulting in some overfitting of the final model. So I decided to use dropout to avoid overfitting. When using Dropout, both validation and training loss decrease to about 0.13 during the first epoch and remain constant for about 10 epochs. After that both loss functions decrease

Error installing pymvpa2 with pip

一个人想着一个人 提交于 2020-05-02 04:48:32
问题 I'm trying to install pymvpa2 in Python 2.7. using pip. I successfully installed other required modules, but I can't install pymvpa2 (I use Python 2.7 and Windows 10). Also, I downloaded swig, but I keep getting the same error message: C:\WINDOWS\system32>cd "C:\Python27\Scripts" C:\Python27\Scripts>pip install pymvpa2 Collecting pymvpa2 Using cached pymvpa2-2.6.1.tar.gz Complete output from command python setup.py egg_info: running egg_info running build_src build_src building extension

How i can extracte x_train and y_train from train_generator?

梦想与她 提交于 2020-04-30 11:42:28
问题 In my CNN model I want to extract X_train and y_train from train_generator. I want to use ensemble learning, bagging and boosting to evaluate the model. the main challenge is how i can extract X_train and y_train from train_generator using python language. history=model.fit_generator(train_generator, steps_per_epoch=num_of_train_samples // batch_size, epochs=10, validation_data=validation_generator, validation_steps=num_of_val_samples // batch_size, callbacks=callbacks) 回答1: Well, first of

Improving the accuracy of image classification model

烂漫一生 提交于 2020-04-30 07:04:48
问题 My aim is to build an image classification model for flowers. The data RAR file consists of a folder named train data which consists of about 16000 images labelled from 0- 16000. Similarly there is a folder for test data also. Apart from this there are two csv workbooks. The first csv workbook consists of two attributes - label & flower class. There are 104 labels & flower classes. The second workbook also consists of two attributes - id & flower class. This csv is the link between the train

Improving the accuracy of image classification model

谁说我不能喝 提交于 2020-04-30 07:03:48
问题 My aim is to build an image classification model for flowers. The data RAR file consists of a folder named train data which consists of about 16000 images labelled from 0- 16000. Similarly there is a folder for test data also. Apart from this there are two csv workbooks. The first csv workbook consists of two attributes - label & flower class. There are 104 labels & flower classes. The second workbook also consists of two attributes - id & flower class. This csv is the link between the train

Keras fit_generator gives a dimension mismatch error

僤鯓⒐⒋嵵緔 提交于 2020-04-30 06:49:07
问题 I am working on MNIST dataset, in which X_train = (42000,28,28,1) is the training set. y_train = (42000,10) is the corresponding label set. Now I create an iterator from the image generator using Keras as follows; iter=datagen.flow(X_train,y_train,batch_size=32) which works fine. Then I train the model using; model.fit_generator(iter,steps_per_epoch=len(X_train)/32,epochs=1) Here it gives the following error; ValueError: Error when checking input: expected dense_9_input to have 2 dimensions,

BERT token importance measuring issue. Grad is none

我只是一个虾纸丫 提交于 2020-04-30 06:36:26
问题 I am trying to measure token importance for BERT via comparing token embedding grad value. So, to get the grad, I've copied the 2.8.0 forward of BertModel and changed it a bit: huggingface transformers 2.8.0 BERT https://github.com/huggingface/transformers/blob/11c3257a18c4b5e1a3c1746eefd96f180358397b/src/transformers/modeling_bert.py Code: embedding_output = self.embeddings( input_ids=input_ids, position_ids=position_ids, token_type_ids=token_type_ids, inputs_embeds=inputs_embeds ) embedding