pearson_correlation_coefficient: Function for Pearson correlation coefficient.

View source: R/customMetrics.R

pearson_correlation_coefficientR Documentation

Function for Pearson correlation coefficient.

Description

Function for Pearson correlation coefficient.

Usage

pearson_correlation_coefficient(y_true, y_pred)

Arguments

y_true

True labels (Tensor)

y_pred

Predictions (Tensor of the same shape as y_true)

Value

Correlation

Author(s)

Tustison NJ

Examples


library( ANTsRNet )
library( keras )

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

metric_pearson_correlation_coefficient <-
  custom_metric( "pearson_correlation_coefficient",
    pearson_correlation_coefficient )

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


ANTsX/ANTsRNet documentation built on April 23, 2024, 1:24 p.m.