Changeset 40325 for trunk/Ohana/src/opihi/lib.data/nnet.c
- Timestamp:
- Jan 27, 2018, 1:09:32 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.data/nnet.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.data/nnet.c
r40320 r40325 143 143 } 144 144 145 void CreateNnetData (Nnet *nnet ) {145 void CreateNnetData (Nnet *nnet, int LargeWeightInit) { 146 146 147 147 ohana_gaussdev_init (); … … 168 168 } 169 169 170 float sigma = LargeWeightInit ? 1.0 : 1.0 / sqrt(nnet[0].Nnodes[i-1]); 171 170 172 ALLOCATE (nnet[0].weight[i], float, nnet[0].Nnodes[i-1]*nnet[0].Nnodes[i]); // weight connected each node in the previous layer to the current layer (excludes input layer) 171 173 for (int j = 0; j < nnet[0].Nnodes[i-1]*nnet[0].Nnodes[i]; j++) { 172 nnet[0].weight[i][j] = ohana_gaussdev_rnd (0.0, 1.0);174 nnet[0].weight[i][j] = ohana_gaussdev_rnd (0.0, sigma); 173 175 } 174 176
Note:
See TracChangeset
for help on using the changeset viewer.
