keras

f-score: ValueError: Classification metrics can't handle a mix of multilabel-indicator and continuous-multioutput targets

半世苍凉 提交于 2021-01-27 17:38:49
问题 I am trying to compute the micro F measure for a prediction my model did. I trained the model using word2vec Vectors with Keras and Tensorflow. I use the scikit library to compute the mirco F measure. But the function throws this message: ValueError: Classification metrics can't handle a mix of multilabel-indicator and continuous-multioutput targets Also, am i doing the prediction right? I trained the model on x_train(wordVectors) and y_train(resultVectors) and validated with x_test and y

How to fine-tune a keras model with existing plus newer classes?

南笙酒味 提交于 2021-01-27 14:03:10
问题 Good day! I have a celebrity dataset on which I want to fine-tune a keras built-in model. SO far what I have explored and done, we remove the top layers of the original model (or preferably, pass the include_top=False) and add our own layers, and then train our newly added layers while keeping the previous layers frozen. This whole thing is pretty much like intuitive. Now what I require is, that my model learns to identify the celebrity faces, while also being able to detect all the other

Transfer learning: model is giving unchanged loss results. Is it not training? [closed]

一笑奈何 提交于 2021-01-27 13:33:14
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 months ago . Improve this question I'm trying to train a Regression Model on Inception V3. Inputs are images of size (96,320,3). There are a total of 16k+ images out of which 12k+ are for training and the rest for validation. I have frozen all layers in Inception, but unfreezing them

Transfer learning: model is giving unchanged loss results. Is it not training? [closed]

≯℡__Kan透↙ 提交于 2021-01-27 13:24:40
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 months ago . Improve this question I'm trying to train a Regression Model on Inception V3. Inputs are images of size (96,320,3). There are a total of 16k+ images out of which 12k+ are for training and the rest for validation. I have frozen all layers in Inception, but unfreezing them

neural network does not learn (loss stays the same)

我与影子孤独终老i 提交于 2021-01-27 13:14:35
问题 My project partner and I are currently facing a problem in our latest university project. Our mission is to implement a neural network that plays the game Pong. We are giving the ball position the ball speed and the position of the paddles to our network and have three outputs: UP DOWN DO_NOTHING. After a player has 11 points we train the network with all states, the made decisions and the reward of the made decisions (see reward_cal()). The problem we are facing is, that the loss is

ValueError: Data cardinality is ambiguous

跟風遠走 提交于 2021-01-27 13:09:35
问题 I'm trying to train LSTM network on data taken from a DataFrame. Here's the code: x_lstm=x.to_numpy().reshape(1,x.shape[0],x.shape[1]) model = keras.models.Sequential([ keras.layers.LSTM(x.shape[1], return_sequences=True, input_shape=(x_lstm.shape[1],x_lstm.shape[2])), keras.layers.LSTM(NORMAL_LAYER_SIZE, return_sequences=True), keras.layers.LSTM(NORMAL_LAYER_SIZE), keras.layers.Dense(y.shape[1]) ]) optimizer=keras.optimizers.Adadelta() model.compile(loss="mse", optimizer=optimizer) for i in

Choose random validation data set

纵然是瞬间 提交于 2021-01-27 13:09:05
问题 Given a numpy array consisting of data which has been generated for ongoing time from a simulation. Based on this I'm using tensorflow and keras to train a neural network and my question refers to this line of code in my model: model.fit(X1, Y1, epochs=1000, batch_size=100, verbose=1, shuffle=True, validation_split=0.2) After having read in the documentation of Keras I found out that the validation data set (in this case 20% of the original data) is sliced from the end. As Im generating data

Keras Python Multi Image Input shape error

橙三吉。 提交于 2021-01-27 11:53:28
问题 I am trying to teach myself to build a CNN that takes more than one image as an input. Since the dataset I created to test this is large and in the long run I hope to solve a problem involving a very large dataset, I am using a generator to read images into arrays which I am passing to Keras Model's fit_generator function. When I run my generator in isolation it works fine, and produces outputs of the appropriate shape. It yields a tuple containing two entries, the first of which has shape (4

Confused about keras Dot Layer. How is the Dot product computed?

前提是你 提交于 2021-01-27 10:46:55
问题 I read all posts about the Dot Layer but none explains how this and so the output shape is computed! It seems so standard though! How exactly are the values computed with a along a specific axis? val = np.random.randint(2, size=(2, 3, 4)) a = K.variable(value=val) val2 = np.random.randint(2, size=(2, 2, 3)) b = K.variable(value=val) print("a") print(val) print("b") print(val2) out = Dot(axes = 2)([a,b]) print(out.shape) print("DOT") print(K.eval(out)) I get: a [[[0 1 1 1] [1 1 0 0] [0 0 1 1]]

Confused about keras Dot Layer. How is the Dot product computed?

a 夏天 提交于 2021-01-27 10:43:20
问题 I read all posts about the Dot Layer but none explains how this and so the output shape is computed! It seems so standard though! How exactly are the values computed with a along a specific axis? val = np.random.randint(2, size=(2, 3, 4)) a = K.variable(value=val) val2 = np.random.randint(2, size=(2, 2, 3)) b = K.variable(value=val) print("a") print(val) print("b") print(val2) out = Dot(axes = 2)([a,b]) print(out.shape) print("DOT") print(K.eval(out)) I get: a [[[0 1 1 1] [1 1 0 0] [0 0 1 1]]