Keras

Machine Learning for Beginners – A Guide to Classification with Keras Deep Learning Library in Python

Machine Learning for Beginners – A Guide to Classification with Keras Deep Learning Library in Python.

Learn Keras by Example – k-Fold Cross-Validating Neural Networks

k-Fold Cross-Validating Neural Networks If we have smaller data it can be useful to benefit from k-fold cross-validation to maximize our ability to evaluate the neural network’s performance. This is possible in Keras because we can “wrap” any neural network such that it can use the evaluation features available in scikit-learn, including k-fold cross-validation. To …

Learn Keras by Example – How to Visualize Performance History

Visualize Performance History Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers import matplotlib.pyplot as plt /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Data /* Set the number of features we want */ number_of_features …

Learn Keras by Example – How to Visualize Neural Network Architecture

Visualize Neural Network Architecture Preliminaries /* Load libraries */ from keras import models from keras import layers from IPython.display import SVG from keras.utils.vis_utils import model_to_dot from keras.utils import plot_model Using TensorFlow backend. Construct Neural Network Architecture /* Start neural network */ network = models.Sequential() /* Add fully connected layer with a ReLU activation function */ …

Learn Keras by Example – How to Visualize Loss History

Visualize Loss History Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers import matplotlib.pyplot as plt /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Data /* Set the number of features we want */ number_of_features …

Learn Keras by Example – How to Save Model Training Progress

Save Model Training Progress Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers from keras.callbacks import ModelCheckpoint #/* Set random seed */ np.random.seed(0) Load IMDB Movie Review Data /* Set the number of features we want */ number_of_features = …

Learn Keras by Example – Preprocessing Data For Neural Networks

Preprocessing Data For Neural Networks Typically, a neural network’s parameters are initialized (i.e. created) as small random numbers. Neural networks often behave poorly when the feature values much larger than parameter values. Furthermore, since an observation’s feature values will are combined as they pass through individual units, it is important that all features have the …

Learn Keras by Example – How to do Neural Network Weight Regularization

Neural Network Weight Regularization Preliminaries /* Load libraries */ import numpy as np from keras.datasets import imdb from keras.preprocessing.text import Tokenizer from keras import models from keras import layers from keras import regularizers /* Set random seed */ np.random.seed(0) Using TensorFlow backend. Load Movie Review Text Data /* Set the number of features we want …