peak_signal_to_noise_ratio: Function to calculate peak-signal-to-noise ratio.

View source: R/customMetrics.R

peak_signal_to_noise_ratioR Documentation

Function to calculate peak-signal-to-noise ratio.

Description

Function to calculate peak-signal-to-noise ratio.

Usage

peak_signal_to_noise_ratio(y_true, y_pred)

Arguments

y_true

True labels (Tensor)

y_pred

Predictions (Tensor of the same shape as y_true)

Value

PSNR value

Author(s)

Tustison NJ

Examples


library( ANTsRNet )
library( keras )

model <- createUnetModel2D( c( 64, 64, 1 ) )

metric_peak_signal_to_noise_ratio <-
  custom_metric( "peak_signal_to_noise_ratio",
    peak_signal_to_noise_ratio )

model %>% compile( loss = loss_categorical_crossentropy,
  optimizer = optimizer_adam( lr = 0.0001 ),
  metrics = c( metric_peak_signal_to_noise_ratio ) )


ANTsX/ANTsRNet documentation built on Nov. 21, 2024, 4:07 a.m.