ftorch_loss Module

Module for the FTorch torch_model type and associated procedures.

  • License FTorch is released under an MIT license. See the LICENSE file for details.

Uses

  • module~~ftorch_loss~~UsesGraph module~ftorch_loss ftorch_loss iso_c_binding iso_c_binding module~ftorch_loss->iso_c_binding module~ftorch_tensor ftorch_tensor module~ftorch_loss->module~ftorch_tensor module~ftorch_types ftorch_types module~ftorch_loss->module~ftorch_types module~ftorch_tensor->iso_c_binding module~ftorch_tensor->module~ftorch_types iso_fortran_env iso_fortran_env module~ftorch_tensor->iso_fortran_env module~ftorch_devices ftorch_devices module~ftorch_tensor->module~ftorch_devices module~ftorch_types->iso_fortran_env module~ftorch_devices->iso_fortran_env

Used by

  • module~~ftorch_loss~~UsedByGraph module~ftorch_loss ftorch_loss module~ftorch ftorch module~ftorch->module~ftorch_loss

Subroutines

public subroutine torch_loss_cross_entropy(loss_tensor, input_tensor, target_tensor, reduction_type)

Evaluate CrossEntropyLoss

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(inout) :: loss_tensor

Tensor to hold the loss value

type(torch_tensor), intent(in) :: input_tensor

Input tensor to evaluate loss at

type(torch_tensor), intent(in) :: target_tensor

Target tensor to evaluate loss against

integer, intent(in), optional :: reduction_type

Optional reduction type (default: torch_kMean)

public subroutine torch_loss_mse(loss_tensor, input_tensor, target_tensor, reduction_type)

Evaluate MSELoss

Read more…

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(inout) :: loss_tensor

Tensor to hold the loss value

type(torch_tensor), intent(in) :: input_tensor

Input tensor to evaluate loss at

type(torch_tensor), intent(in) :: target_tensor

Target tensor to evaluate loss against

integer, intent(in), optional :: reduction_type

Reduction type to use over batches (default: torch_kMean)