What is the definition of a non-trainable parameter?

In keras, non-trainable parameters (as shown in model.summary()) means the number of weights that are not updated during training with backpropagation. There are mainly two types of non-trainable weights: The ones that you have chosen to keep constant when training. This means that keras won’t update these weights during training at all. The ones that … Read more

Getting gradient of model output w.r.t weights using Keras

To get the gradients of model output with respect to weights using Keras you have to use the Keras backend module. I created this simple example to illustrate exactly what to do: from keras.models import Sequential from keras.layers import Dense, Activation from keras import backend as k model = Sequential() model.add(Dense(12, input_dim=8, init=”uniform”, activation=’relu’)) model.add(Dense(8, … Read more

How to switch Backend with Keras (from TensorFlow to Theano)

Create a .keras (note the . in front) folder in you home directory and put the keras.json file there. For example, /home/DaniPaniz/.keras/keras.json (or ~/.keras/keras.json in short) if you are on a UNIX like system (MacOS X, Linux, *BSD). On Windows you want to create the folder %USERPROFILE%/.keras and put the JSON file there. Alternatively, you … Read more

How to compute Receiving Operating Characteristic (ROC) and AUC in keras?

Due to that you can’t calculate ROC&AUC by mini-batches, you can only calculate it on the end of one epoch. There is a solution from jamartinh, I patch the code below for convenience: from sklearn.metrics import roc_auc_score from keras.callbacks import Callback class RocCallback(Callback): def __init__(self,training_data,validation_data): self.x = training_data[0] self.y = training_data[1] self.x_val = validation_data[0] self.y_val … Read more

How do I install Keras and Theano in Anaconda Python on Windows?

It is my solution for the same problem Install TDM GCC x64. Install Anaconda x64. Open the Anaconda prompt Run conda update conda Run conda update –all Run conda install mingw libpython Install the latest version of Theano, pip install git+git://github.com/Theano/Theano.git Run pip install git+git://github.com/fchollet/keras.git

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)