Inhibiting learning after mean error is below threshold

Hello, it seems that in networks with learning connections, it would be useful to have a means of inhibiting the error signal when the error averaged over some time interval is below a configurable threshold. I was wondering if anyone has implemented this. I came across the blog post below, which describes a “low-pass derivative filter” that is very similar to what I have in mind, but the code appears to use an older and much different API. What would be a good way to implement an inhibitory signal based on the mean absolute error over time?

It would depend if you want your mean error tracking to be implemented neurally or not. If you just want this to work functionally, I would use a Node. The Node would take the error signal as input, track the mean over time, and then if it crosses the threshold it would output 0 for the error (otherwise it’d output the input error value). If you wanted to implement that computation neurally, then it would be more complicated.