tsoding / nn.h

Simple stb-style header-only library for Neural Networks
MIT License
342 stars 35 forks source link

Small backprop optimization, fix gym.h #16

Open Synray opened 1 year ago

Synray commented 1 year ago

Instead of averaging every parameter's gradient at the end, just average the output gradient at the start, reducing the number of divisions. This is equivalent because the 1/n term propagates backwards to all the gradients.