Categories
Mastering Development

Boolean Labels Training with Keras causes the error “Please provide data which shares the same first dimension”

So, here is what I am trying to do. My model has to receive a number of training samples, each a conjunction of Boolean literals (i.e. a vector of 0 or 1s) assigned with a truth value. Learning from the samples, it must be able to receive some test vector and determine its truth value. […]

Categories
Mastering Development

Using pretrained model as input for single branch in multi-input model

I have a pre-trained model that I created using the Keras functional API. What I am trying to do is the following: Retrain the layers of the pretrained model and use this for a particular branch Normalize with BatchNormalization() the branch layer Concat layers and output to single layer. Note that this approach does work […]

Categories
Mastering Development

I want to change the specific prediction of my CNN-model to a probability

I trained a model to categorize pictures in two different types. Everything is working quite good, but my Model can only do a specific prediction (1 or 0 in my case), but I am interested to have a prediction which is more like a probability (For example 90% 1 and 10% 0). Where is the […]

Categories
Mastering Development

how to change layer shape in keras?

I have a decoder that has output (28,28,1) I am trying that the output of a decoder has (32,32,3) how can i achieve that? i am using colab with gpu t4 latent_dim = 20 encoder_inputs = keras.Input(shape=(28, 28, 1)) x = layers.Conv2D(32, 3, activation="relu", strides=2, padding="same")(encoder_inputs) x = layers.Conv2D(64, 3, activation="relu", strides=2, padding="same")(x) x = […]

Categories
Mastering Development

Neural Network ValueError

I am currently trying to run a neural network to predict whether a given house is above or below the median housing value. I have six inputs which include square feet, number of bedrooms, number of bathrooms, number of garage spaces, etc. The response variable is a binary variable indicated whether the price is below […]

Categories
Mastering Development

Keras autoencoder is not reconstructing 1D signals

I would like to train an autoencoder neural network. Assume I have a 1D signal: Then in order to create a dataset, I split this signal into several thousands of (overlapping) segments (each with 1024 samples). Each segment is saved into a separate .txt file. My code is following import tensorflow as tf import tensorflow.keras […]

Categories
Mastering Development

How can I use less memory for a large dataset of images? (Python – Keras)

I’m new to deep learning. I’m trying to train a model that identifies plant diseases, and I’m using this dataset that has a bunch of images. I’m aware that this is a lot of data, and I’m only using the color subfolder. I want to use all of the data in that subfolder. The thing […]

Categories
Mastering Development

How to use cross validation in keras classifier

I have been trying to implement K-fold cross validation in keras classifer for hours but I am getting NaNs all the time. How to use the cross validation with RECALL as the scoring metric? Note The data is not corrupt and Xtrain and ytrain are correctly splitted. However, to my surprise cross validation is not […]

Categories
Mastering Development

Tensorflow with gpu Quadro M1200 in windows 10

I was able to install NVIDIA drivers for my modest Quadro M1200 and run TensorFlow 2.3.0. testing TensorFlow with GPU works: In [2]: tf.config.list_physical_devices(‘GPU’) Tt returns Out[2]: [PhysicalDevice(name=’/physical_device:GPU:0′, device_type=’GPU’)] and also some details sush as: Successfully opened dynamic library nvcuda.dll Found device 0 with properties: pciBusID: 0000:01:00.0 name: Quadro M1200 computeCapability: 5.0 Successfully opened dynamic […]

Categories
Mastering Development

Accuracy of Tenserflow model changes a lot each time i run model.fit

My project is to try and find out if I can predict gender of people speaking near phone from data from gyroscope and accelerometer. I have 315 examples(60sec each) and each example has 2997 lines where each line represents magnitude of vector from gyro/accelerometer xyz axis. I shuffled input and output by same seed and […]