Created
July 15, 2022 10:36
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
setupModel() { | |
// Create a sequential neural network | |
this.model = tf.sequential(); | |
let hidden1 = tf.layers.dense({ | |
units: 8, | |
activation: "relu", | |
inputDim: 5, | |
}); | |
let outputLayer = tf.layers.dense({ | |
units: 4, | |
activation: "sigmoid", | |
}); | |
this.model.add(hidden1); | |
this.model.add(outputLayer); | |
//Compile | |
this.model.compile({ | |
optimizer: "adam", | |
loss: "binaryCrossentropy" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment