Skip to content

Instantly share code, notes, and snippets.

@MCarlomagno
Created October 17, 2020 20:16
Show Gist options
  • Save MCarlomagno/84cd0510bc77064238684e8d636ac19e to your computer and use it in GitHub Desktop.
Save MCarlomagno/84cd0510bc77064238684e8d636ac19e to your computer and use it in GitHub Desktop.
var buildModel = function () {
var model = tf.sequential();
model.add(tf.layers.dense({ units: 24, inputShape: [6], activation: 'relu' })); // input shape === state shape
model.add(tf.layers.dense({ units: 24, activation: 'relu' }));
model.add(tf.layers.dense({ units: 9, activation: 'linear' })); // units === action_size
model.compile({ loss: tf.losses.huberLoss, optimizer: tf.train.adam(learningRate) });
return model
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment