Model

NNJulia.TrainParametersType
TrainParameters(opt::AbstractOptimiser, lossFunction::AbstractLoss, metrics::AbstractMetrics)

This struct store the important parameters used to train the model.

Fields

  • opt: The optimiser used to optimise the loss
  • lossFunction: The function used to compute the loss
  • metrics: The metrics used to compute the accuracy of the model
source
NNJulia.train!Function
train!(model::AbstractModel, trainParams::TrainParameters, trainData::DataLoader, nbEpochs::Int, verbose::Bool=true)

This method train a model on the trainData. The accuracy and the loss computed at each epoch is stored into a dictionnary that is returned at the end of the training.

The dictionnary returned looks like this : history = Dict("accuracy" => Float64[], "loss" => Float64[])

source
NNJulia.evaluateFunction
evaluate(model::AbstractModel, metrics::BinaryAccuracy, xData::Union{Tensor,AbstractArray,Float64,Int64}, yData::Union{Tensor,AbstractArray,Float64,Int64})

This method evaluate a model by returning the accuracy computed with the given metrics

source