deep-learning

keras predict always output same value in multi-classification

天涯浪子 提交于 2020-07-04 13:09:44
问题 here is my code. I want to made a multi-classification using Keras. the vcl_acc is better when training, But the predict value always is a same value. I confused,please help me train.py # coding: UTF-8 # author: Sun Yongke (sunyongke@gmail.com) from keras.preprocessing.image import ImageDataGenerator from keras.callbacks import EarlyStopping from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D

keras predict always output same value in multi-classification

六月ゝ 毕业季﹏ 提交于 2020-07-04 13:08:20
问题 here is my code. I want to made a multi-classification using Keras. the vcl_acc is better when training, But the predict value always is a same value. I confused,please help me train.py # coding: UTF-8 # author: Sun Yongke (sunyongke@gmail.com) from keras.preprocessing.image import ImageDataGenerator from keras.callbacks import EarlyStopping from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D

keras predict always output same value in multi-classification

ぐ巨炮叔叔 提交于 2020-07-04 13:07:38
问题 here is my code. I want to made a multi-classification using Keras. the vcl_acc is better when training, But the predict value always is a same value. I confused,please help me train.py # coding: UTF-8 # author: Sun Yongke (sunyongke@gmail.com) from keras.preprocessing.image import ImageDataGenerator from keras.callbacks import EarlyStopping from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D

An error while using tune for hyper-parameters a deep learning model

孤人 提交于 2020-06-29 04:43:03
问题 I'm trying to use tune to tune my model in Pytorch (https://docs.ray.io/en/latest/tune.html), as a starting point; I just tried to run their small example: import torch.optim as optim from ray import tune from ray.tune.examples.mnist_pytorch import get_data_loaders, ConvNet, train, test def train_mnist(config): train_loader, test_loader = get_data_loaders() model = ConvNet() optimizer = optim.SGD(model.parameters(), lr=config["lr"]) for i in range(10): train(model, optimizer, train_loader)

Neural network in R for predictions 1 day, 2 days and 3 days ahead

ε祈祈猫儿з 提交于 2020-06-29 03:39:16
问题 I am using ann in R. I have (time series) daily data which has 6400 rows and 3 input variables A, B, C and 2 output variables D, E. I can predict D and E variables based on input A, B and C. This is what I have tried: data <- data.frame(A, B, C, D, E) index <- 1:5844 datatrain = data[index, ] datatest = data[-index, ] max = apply(data , 2 , max) min = apply(data, 2 , min) scaled = as.data.frame(scale(data, center = min, scale = max - min)) train = scaled[index , ] test = scaled[-index , ] NN

Grid Search fit not accepting list of tensors

旧街凉风 提交于 2020-06-28 04:41:12
问题 I have a siamese network and I want to perform a grid seach on it using GridSearchCV. So I create a model using the following function: def createMod(learn_rate=0.01, optimizer='Adam'): #K.clear_session() # network definition base_network = create_base_network(input_shape) input_a = Input(shape=input_shape) input_b = Input(shape=input_shape) # because we re-use the same instance `base_network`, # the weights of the network will be shared across the two branches processed_a = base_network

Tensorflow pad sequence feature column

只谈情不闲聊 提交于 2020-06-28 04:37:55
问题 How to pad sequences in the feature column and also what is a dimension in the feature_column . I am using Tensorflow 2.0 and implementing an example of text summarization. Pretty new to machine learning, deep learning, and TensorFlow. I came across feature_column and found them useful as I think they can be embedded in the processing pipeline of the model. In a classic scenario where not using feature_column , I can pre-process the text, tokenize it, convert it into a sequence of numbers and

Access dockerfiles for the GCP deep-learning-platform images

為{幸葍}努か 提交于 2020-06-27 18:54:29
问题 I'm using images derived from the deep-learning containers to run several tasks in the AI Platform Notebooks product. In order to make some changes to my derived images, it would be really helpful to know how the parent images are built but I can't find a repository for the code that actually builds the images (ie. the Dockerfiles) anywhere. Does anyone know where these can be found? I can obviously pull up the container registry, but that doesn't help me to see how the images are built... 来源

Segnet in Keras: total size of new array must be unchanged error

不羁岁月 提交于 2020-06-27 11:19:20
问题 I am implementing Segnet in Python. Following is the code. img_w = 480 img_h = 360 pool_size = 2 def build_model(img_w, img_h, pool_size): n_labels = 12 kernel = 3 encoding_layers = [ Conv2D(64, (kernel, kernel), input_shape=(img_h, img_w, 3), padding='same'), BatchNormalization(), Activation('relu'), Convolution2D(64, (kernel, kernel), padding='same'), BatchNormalization(), Activation('relu'), MaxPooling2D(pool_size = (pool_size,pool_size)), Convolution2D(128, (kernel, kernel), padding='same

AttributeError: 'str' object has no attribute 'ndim' [closed]

有些话、适合烂在心里 提交于 2020-06-27 08:17:16
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I'm using Keras to implement a sentiment analysis code. I have my training data as follows: pos.txt : text file of all positive reviews separated by line neg.txt : text file of all negative reviews separated by line I build my code in a similar fashion to here The only difference