Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed May 30, 2024
1 parent f4edfc3 commit 309b81d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# system-a

[models] `accurateEnoughIrisTrainParameters`
[models] `gridSearch`

# the-book
Expand Down
14 changes: 10 additions & 4 deletions src/system-a/models/iris/irisModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
denseBlock,
denseInitParameters,
} from "../../block/index.js"
import { gradientDescentNaked } from "../../gradient-descent/gradientDescentNaked.js"
import { gradientDescentAdam } from "../../gradient-descent/gradientDescentAdam.js"
import { l2Loss } from "../../loss/index.js"
import type { Tensor } from "../../tensor/Tensor.js"
import { samplingObjective } from "../../tensor/samplingObjective.js"
Expand All @@ -24,12 +24,18 @@ export function irisTrainParameters(): Array<Tensor> {

const initParameters = denseInitParameters(irisNetwork.shapes)

const gradientDescentFn = gradientDescentNaked({
learningRate: 0.0002,
// const gradientDescentFn = gradientDescentNaked({
// learningRate: 0.0002,
// })

const gradientDescentFn = gradientDescentAdam({
learningRate: 0.002,
decayRate: 0.9,
relayFactor: 0.85,
})

return gradientDescentFn(objective, initParameters, {
revs: 2000,
revs: 1000,
})
}

Expand Down

0 comments on commit 309b81d

Please sign in to comment.