Skip to content

Instantly share code, notes, and snippets.

@georgeperry1
Created July 12, 2019 15:23
Show Gist options
  • Save georgeperry1/0b75749875f0c9e538342cbc570de49a to your computer and use it in GitHub Desktop.
Save georgeperry1/0b75749875f0c9e538342cbc570de49a to your computer and use it in GitHub Desktop.
const model = tf.sequential();
// Add layers to the model
model.add(tf.layers.dense({
inputShape: [512],
activation: 'sigmoid',
units: 2,
}));
model.add(tf.layers.dense({
inputShape: [2],
activation: 'sigmoid',
units: 2,
}));
model.add(tf.layers.dense({
inputShape: [2],
activation: 'sigmoid',
units: 2,
}));
// Compile the model
model.compile({
loss: 'meanSquaredError',
optimizer: tf.train.adam(.06), // This is a standard compile config
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment