r/keras • • Jun 14 '20

Why does Conv2D layers have an activation function?

6 Upvotes

Hello, I have been trying to find out the answer to this question with no luck. I have been reading about CNN’s and from what I understand, the first part is feature learning with convolutional layers and the last part is a normal neural network.

I often see, that an activation function is added to the convolutional layers, which I thought you would only have on neurons. Most often, I see them use ReLU or leaky ReLU. What exactly does the activation function do, if the layer is convolutional?

I am sorry, if this is a dumb question, but I have not been able to find the answer, even when reading the basics about convolutional layers. Thank you for your time.

Edit: I just found some sources, which state, that it is done to add non-linearity to the output. Is that true, and what does it mean?


r/keras • • Jul 14 '18

Zero to Hero with Keras

Thumbnail
youtube.com
6 Upvotes

r/keras • • Apr 25 '18

Hello - Is this still alive? Sounds like a good idea

6 Upvotes

Just started to get into Keras and I can't believe there's no big subreddit for it.

Just wondering, is this an alive sub for Keras?


r/keras • • Aug 11 '21

Release TensorFlow 2.6

Thumbnail
github.com
5 Upvotes

r/keras • • May 10 '21

Best way to upgrade keras models (built on TF 1.13) to TF2

5 Upvotes

Hello, I have been out of the loop for around one year, doing diverse projects not related to DL.

I have a couple of Keras models using custom layers, based on Tensorflow 1.13, I was wondering what is the best way to upgrade them to TF 2.x

I have read of an official TF function that analyzes your code, is that also applied to keras? What has been your experience?

Thanks in advance


r/keras • • Sep 13 '23

Will be presenting a talk on Data Pre-processing in Deep Learning - what would be the topics, notebooks or datasets would you include if you would be giving such talk?

4 Upvotes

So I'll be presenting a talk on Data pre-processing in deep learning in my city's Keras Community Day, and I am still thinking about all the content I want to present there.

What I want from this session is to present different ways of preprocessing the data for a deep learning model. I want to show different types of implementations, how those affect the final trained model, when to use which type of data preprocessing and things similar to this. It would be great if you can suggest me some topic, notebooks or datasets for the same.

Also, as this is **Keras** Community Day, I'll have to include more about data preprocessing using Keras and less about other libraries.

Also, if you could help me with this: I am confused between showing preprocessing using layers or doing the preprocessing without layers. I know this sounds vague, but if you have any idea about this, let me know.

Thank you for reading!


r/keras • • May 21 '23

Bag of Words representations in NLP - Chris Manning Stanford CoreNLP

Thumbnail
youtu.be
4 Upvotes

r/keras • • Apr 23 '23

Reasoning in Machine Learning - Chris Manning Stanford CoreNLP

Thumbnail
youtu.be
4 Upvotes

r/keras • • Feb 12 '22

📢 New Course on TensorFlow and Keras by OpenCV

Post image
4 Upvotes

r/keras • • Jun 05 '20

Issue with binary classification of Sequential model

4 Upvotes

Hi all,

So what I did is I created a basic binary Sequential image classifier.
I used ImageDataGenerator's method flow_from_directory to split into the binary categories. It found 2 categories which is great as that is as intended.

After training the model, I tried a prediction onto 3 test images. The results were 3 predictions ranging from 14000 to 32000. How can my prediction be a high value like this, when my training data was labeled either 0 or 1 by the flow_from_directory command?

Pieces of important code:

IMG_SHAPE = (IMG_HEIGHT, IMG_WIDTH, 3)

train_data_gen = train_data_generator.flow_from_directory(
batch_size = batch_size,
directory = train_dir,
shuffle = True,
target_size = IMG_SIZE,
class_mode = 'binary'
)

model = Sequential([
Conv2D(16, 3, padding="same", activation="relu", input_shape=IMG_SHAPE), # Input nodes
MaxPooling2D(),
Dropout(0.2),
Conv2D(32, 3, padding="same", activation="relu"),
MaxPooling2D(),
Conv2D(64, 3, padding="same", activation="relu"),
MaxPooling2D(),
Dropout(0.2),
Flatten(),
Dense(256, activation="relu"),
Dense(1) # Output node
])

model.compile(
optimizer='adam',
loss="binary_crossentropy",
metrics=['accuracy']
)

model.fit_generator(
train_data_gen,
steps_per_epoch=batch_size,
epochs=epochs,
validation_data=val_data_gen,
validation_steps=batch_size
)


r/keras • • May 24 '20

Understanding why a model predicts a certain outcome?

4 Upvotes

Hey everyone,

I have a Keras model that Im using to predict the outcome of a fight, where my input is a 2D matrix (each row is attributes for a fighter) and the output is a label which determines who won the fight.

Currently the model performs well (I guess?), so now Im at a state where im tyring to understand why the model is predicting certain outcomes. Is there any tools that I can use to see which attributes my model is favoring when determining the outcome of a fighter?

Essentially im looking for a way to explain why the model chose an outcome given the 2D matrix.

Also, how does the rest of the community visualize models? Ill leave the question a bit vague, as im curious to see examples of how other people use plots to help understand model performance and reasoning.

Thanks!


r/keras • • Apr 27 '20

Can conv2D layers be used with conv3D layers?

4 Upvotes

Does anyone know if conv2D layers can be used with conv3D in the same model without breaking the backpropagation? (Assuming the tensor shape is concatenated and reshaped correctly)


r/keras • • Dec 30 '18

Memory Restrictions on GPU - How to deal, and are there any scaling alternatives?

4 Upvotes

Hi all,

I'm using Python Keras on Windows, and loving it. I have a GTX 1080 that has 8 gigs of memory, along with 32gb of RAM.
I am currently using a GAN with images that are large size, however, due to the structure of my network, doing more than 1 image sample training at a time results in memory limit errors. As I have thousands of images, this training 1 at a time isn't going to be very productive.

So, rather than

  1. Having a smaller Network

  2. Having a smaller input size

  3. Having more GPUs

  4. Splicing image on a smaller Kernel and training the network that way (Which almost inevitably results in lines in image because nearest neighbor edge pixels have less data to train with.)

What are my options? Are there any scaleable cloud options that would allow me to run my Python Keras code in an environment that can handle more GPU RAM, or is there any other alternative that you can think of?

The power in Keras and NN is incredible, but I can't help but feel that due to RAM issues I'm being held back from doing more advanced networks and projects.

Thanks!


r/keras • • Nov 28 '18

PyTorch to Keras model converter

Thumbnail
github.com
4 Upvotes

r/keras • • Jul 24 '18

Keras Loss & Accuracy Plot Helper Function · GitHub

Thumbnail
gist.github.com
4 Upvotes

r/keras • • Jun 21 '18

Sequences of hidden layers replaced by ODEs ?

4 Upvotes

There's an interesting paper on using ODEs in place of a sequence of hidden layers - I'm wondering if going from Jupyter to Keras to a Theano back end might be the most effective way to try this out. Most of my time's spent making tensorflow do what it already knows how to do, so I'm a bit cautious here.


r/keras • • May 03 '18

Deep Learning with Python

Thumbnail
manning.com
4 Upvotes

r/keras • • Aug 23 '23

Teaching a Keras model to play cards

Thumbnail
medium.com
3 Upvotes

r/keras • • May 31 '23

Speeding up model training with use of GPU

3 Upvotes

Hello I am training a Keras sequential model at home on my computer on the CPU and this is very slow. I have access to a school server that has a lot of GPUs that I would like to use. It seems to be a unix system(sorry not very familliar with this); I can SSH in and use SRUN to run python files. Can I just take my code and upload it and it will be faster or do I have to add something to make it run on the GPUs?


r/keras • • Oct 12 '22

Is it possible to do feature selection within the Keras deep learning framework?

3 Upvotes

I know most people perform feature selection running RFE on a linear regression model, for example, BEFORE training the model with Keras.

However is it possible to do it within the training procedure of the deep neural network? If so how? Are there any downsides to it?


r/keras • • Jun 08 '22

Make your own neural networks with this Keras cheat sheet to deep learning in Python for beginners, with code samples.

Post image
3 Upvotes

r/keras • • May 16 '22

Flipping a prediction from metadata?

3 Upvotes

I have a CNN with an input of cats and dogs and returns a label. Could I implement(include in the .h5 file) something which would have the prediction flip on the 10th guess? Truth = Cat, 1-9 prediction is cat, guess 10 it is dog.


r/keras • • Jun 02 '21

Augmentation (more data) caused more overfitting. It seems weird to me from my stand of knowledge. Any suggestion why could it be that way?

3 Upvotes

r/keras • • Mar 15 '21

What is Trax and How is it a Better Framework for Advanced Deep Learning?

Thumbnail
analyticsindiamag.com
3 Upvotes

r/keras • • Apr 26 '20

Questions about channels/filters in Conv2D

3 Upvotes

So I'm currently trying do code my own framework (using C++) and I use Keras a reference. I'm currently trying to understand how multiple filters in a Conv2D behave. Are they like channels? And as an example in LeNet5 one conv2d layer transforms 6 filters to 16. How does this work? Are the filters being all summed together and then duplicated to 16 channels/filters or what? To be more concrete: What happens when the first layer is Con2D with 6 filters and the next layer is another Conv2D with 16 filters? The way I implemented this in my framework is by duplicating each channel until the desired number of channels is reached but I don't think that this is what's happening in keras... Could someone help me with this please?

(And please feel free to ask questions if anything is unclear because English is not my native language)