wandb_post_epoch_hook Subroutine

private subroutine wandb_post_epoch_hook(this, epoch, loss, accuracy)

Called automatically at the end of each training epoch. Logs "loss" and "accuracy" to the current W&B run.

Type Bound

wandb_network_type

Arguments

Type IntentOptional Attributes Name
class(wandb_network_type), intent(inout) :: this

Network instance

integer, intent(in) :: epoch

Current epoch number (1-based)

real(kind=real32), intent(in) :: loss

Mean loss over the epoch

real(kind=real32), intent(in) :: accuracy

Mean accuracy over the epoch


Source Code

  subroutine wandb_post_epoch_hook(this, epoch, loss, accuracy)
    !! Called automatically at the end of each training epoch.
    !! Logs "loss" and "accuracy" to the current W&B run.
    implicit none

    ! Arguments
    class(wandb_network_type), intent(inout) :: this
    !! Network instance
    integer, intent(in) :: epoch
    !! Current epoch number (1-based)
    real(real32), intent(in) :: loss
    !! Mean loss over the epoch
    real(real32), intent(in) :: accuracy
    !! Mean accuracy over the epoch

    call wandb_log("loss",     loss,     step=epoch)
    call wandb_log("accuracy", accuracy, step=epoch)

  end subroutine wandb_post_epoch_hook