Created
November 14, 2018 20:37
-
-
Save Marina-Miranovich/1704553e494389356609f645c6d66dea to your computer and use it in GitHub Desktop.
code_snippet_2 for "Playing Mortal Kombat with TensorFlow.js. Transfer learning and data augmentation" translation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as tf from '@tensorflow/tfjs'; | |
const model = tf.sequential(); | |
model.add(tf.layers.inputLayer({ inputShape: [1024] })); | |
model.add(tf.layers.dense({ units: 1024, activation: 'relu' })); | |
model.add(tf.layers.dense({ units: 1, activation: 'sigmoid' })); | |
model.compile({ | |
optimizer: tf.train.adam(1e-6), | |
loss: tf.losses.sigmoidCrossEntropy, | |
metrics: ['accuracy'] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment