Skip to content

Commit 6d51ce0

Browse files
committed
Set/get command for hidden neurons via UART.
1 parent 9da2f02 commit 6d51ce0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

main.go

+14
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,20 @@ func main() {
129129
uart.WriteUint8(network.OutputCount)
130130
break
131131

132+
case N2CMU_SET_HIDDEN_NEURON:
133+
for i := 0; i < int(network.HiddenCount); i++ {
134+
network.HiddenNeuron[i] = uart.ReadFloat32()
135+
}
136+
137+
uart.WriteOk()
138+
break
139+
140+
case N2CMU_GET_HIDDEN_NEURON:
141+
for i := 0; i < int(network.HiddenCount); i++ {
142+
uart.WriteFloat32(network.HiddenNeuron[i])
143+
}
144+
break
145+
132146
case N2CMU_SET_EPOCH_COUNT:
133147
epoch = uart.ReadUint16()
134148
break

0 commit comments

Comments
 (0)