목차

Perceptron

Each neuron can be initialized with specific weights. Keras provides a few choices, the most common of which are listed as follows:

A full list is available at https://keras.io/initializations/
Keras supports a number of activation functions, and a full list is available at https://keras.io/activations/.

One-hot encoding - OHE

Once we define the model, we have to compile it so that it can be executed by the Keras backend(either Theano or TensorFlow). Theare are a few choices to be made during compilation:

Once the model is compiled, it can be then trained with the fit() function, which specifies a few parameters:

snippet.python
score = model.evaluate(X_test, Y_test, verbose=VERBOSE)
print("Test score:", score[0])
print('Test accuracy:', score[1])

Predictg output

When a net is trained, it can be course be used for predictions. In Keras, this is very simple. We can use the following method:

snippet.python
# Ccalculate predictions
predictions = model.predict(X)

For a given input, several types of output can be computed, including a method:

Configuring Keras

th : (depth, width, and height)

tf : (width, height, and depth)

If you install a GPU-enabled TensorFlow version, then Keras will automatically use your configured GPU when TensorFlow is selected as the backend


관련 문서