-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
26 lines (21 loc) · 672 Bytes
/
main.go
File metadata and controls
26 lines (21 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"fmt"
"github.com/sauryagur/neural-network-from-scratch/mnist"
"github.com/sauryagur/neural-network-from-scratch/utils/initialise"
)
func main() {
trainInputs, trainLabels, testInputs, _, err := mnist.LoadMNIST(
"mnist/data/mnist/train-images.idx3-ubyte",
"mnist/data/mnist/train-labels.idx1-ubyte",
"mnist/data/mnist/t10k-images.idx3-ubyte",
"mnist/data/mnist/t10k-labels.idx1-ubyte",
)
if err != nil {
panic(err)
}
fmt.Printf("Loaded %d train, %d test\n", len(trainInputs), len(testInputs))
mlp := initialise.InitMLP(784, 10, []int{128, 64}, 0.05)
mlp.EnableSoftMax = true
mlp.Train(trainInputs, trainLabels, 100, 0.01)
}