Created
July 15, 2022 10:36
-
-
Save LiorB-D/6608c59efebfd2c8ad68b6d74ffa40fa to your computer and use it in GitHub Desktop.
This file contains hidden or 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