Skip to content

Commit

Permalink
change comments
Browse files Browse the repository at this point in the history
  • Loading branch information
retraigo committed Dec 10, 2023
1 parent cb38f3a commit 3684295
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions examples/classification/iris.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ const net = new Sequential({

// Define each layer of the network
layers: [
// A dense layer with 4 neurons
// A dense layer with 16 neurons
DenseLayer({ size: [16] }),
// A sigmoid activation layer
// A ReLu activation layer
ReluLayer(),
// A dense layer with 1 neuron
// A dense layer with 3 neurons
DenseLayer({ size: [3] }),
// Another sigmoid layer
// A Softmax activation layer
SoftmaxLayer(),
],
optimizer: AdamOptimizer(),
// We are using MSE for finding cost
// We are using CrossEntropy for finding cost
cost: Cost.CrossEntropy,
scheduler: OneCycle({ max_rate: 0.05, step_size: 50 }),
});
Expand All @@ -83,7 +83,7 @@ net.train(
outputs: tensor2D(train[1]),
},
],
// Train for 10000 epochs
// Train for 300 epochs
300,
1,
0.02,
Expand Down
4 changes: 2 additions & 2 deletions examples/classification/spam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const net = new Sequential({
SigmoidLayer(),
],

// We are using MSE for finding cost
// We are using Log Loss for finding cost
cost: Cost.BinCrossEntropy,
optimizer: AdamOptimizer(),
});
Expand All @@ -106,7 +106,7 @@ net.train(
outputs: tensor2D(train[1].map((x) => [x])),
},
],
// Train for 10000 epochs
// Train for 20 epochs
20,
1,
0.01,
Expand Down

0 comments on commit 3684295

Please sign in to comment.