MCPcopy Create free account
hub / github.com/davisking/dlib / reset

Method reset

dlib/mlp/mlp_kernel_1.h:103–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 ) {}
102
103 void reset (
104 )
105 {
106 // randomize the weights for the first layer
107 for (long r = 0; r < w1.nr(); ++r)
108 for (long c = 0; c < w1.nc(); ++c)
109 w1(r,c) = rand_nums.get_random_double();
110
111 // randomize the weights for the second layer
112 for (long r = 0; r < w2.nr(); ++r)
113 for (long c = 0; c < w2.nc(); ++c)
114 w2(r,c) = rand_nums.get_random_double();
115
116 // randomize the weights for the third layer
117 for (long r = 0; r < w3.nr(); ++r)
118 for (long c = 0; c < w3.nc(); ++c)
119 w3(r,c) = rand_nums.get_random_double();
120
121 // zero all the momentum terms
122 set_all_elements(w1m,0);
123 set_all_elements(w2m,0);
124 set_all_elements(w3m,0);
125 }
126
127 long input_layer_nodes (
128 ) const { return input_nodes; }

Callers

nothing calls this directly

Calls 4

set_all_elementsFunction · 0.85
get_random_doubleMethod · 0.80
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected