README

Start here

Library

Reference

Tutorials

Other

public Metricparametric type

Metric(metricfn[; statistic, device, name])

Implementation of AbstractMetric that can be used with the Metrics callback.

Arguments

  • metricfn(ŷs, ys) should return a number.
  • statistic is a OnlineStats.Statistic that is updated after every step. The default is OnlineStats.Mean()
  • name is used for printing.
  • device = cpu is a function applied to ys and ŷs before calling metricfn. If metricfn works on the GPU, you may want to pass Flux.gpu here for better performance.

Examples

  • Metric(accuracy)
  • Metric(Flux.mse, device = gpu)
  • Metric(Flux.mae, device = gpu)