Skip to content

Commit

Permalink
Create neural_network_library.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 28, 2024
1 parent 4f2349f commit f66cca5
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Neural network library implementation
class NeuralNetwork {
constructor() {
this.layers = [];
}

addLayer(layer) {
// Add layer to neural network
this.layers.push(layer);
}

run(data) {
// Run neural network on input data
let output = data;
for (const layer of this.layers) {
output = layer.run(output);
}
return output;
}
}

export default NeuralNetwork;

0 comments on commit f66cca5

Please sign in to comment.