fix: fill biases with zeros in fill_random
This commit is contained in:
@@ -81,7 +81,7 @@ private:
|
|||||||
void fill_random(const Dist& dist) {
|
void fill_random(const Dist& dist) {
|
||||||
T scale = std::sqrt(2.0 / static_cast<T>(INPUT_FEATURES));
|
T scale = std::sqrt(2.0 / static_cast<T>(INPUT_FEATURES));
|
||||||
weights = decltype(weights)::random(dist) * scale;
|
weights = decltype(weights)::random(dist) * scale;
|
||||||
biases = decltype(biases)::random(dist) * scale;
|
biases = decltype(biases){};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& forward(const input_type& input) { return output = (input.get() * weights) + biases; }
|
auto& forward(const input_type& input) { return output = (input.get() * weights) + biases; }
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user