Flux callback using accuracy not found

I start to work with the Flux.jl to create neural networks. Using the documentation Flux_Callback I wanted touse a callback for a train model.

Using the suggested callback

cb = function ()
accuracy() > 0.9 && Flux.stop()

ends in the error “accuracy not defined”. Does anybody know how to import the accuracy function in Flux? I already tried Flux.accuracy() but I get the same error.

accuracy is just provided as an example and isn’t an actual function in Flux. Thankfully, writing your own implementation should be pretty straightforward :slight_smile:

I see :slight_smile: thank you!
I was just confused since I worked with Knet too, and it is using the same function which is already Implemented.