Skip to content

Add deeplearning reconstruction metrics#152

Open
sergioald wants to merge 1 commit into
GeoOcean:developfrom
sergioald:add-deeplearning-reconstruction-metrics
Open

Add deeplearning reconstruction metrics#152
sergioald wants to merge 1 commit into
GeoOcean:developfrom
sergioald:add-deeplearning-reconstruction-metrics

Conversation

@sergioald

Copy link
Copy Markdown
Collaborator

This PR adds reusable reconstruction metrics for the deeplearning module.

The metrics are implemented in a separate metrics.py module so they can be reused beyond the autoencoder classes and also used as differentiable PyTorch losses during training.

Changes include:

  • Add reconstruction_error()
  • Add evaluate_reconstruction()
  • Add ReconstructionLoss
  • Support MSE, MAE and RMSE
  • Support none, sample, mean and sum reductions
  • Support both NumPy arrays and PyTorch tensors
  • Preserve gradients when PyTorch tensors are used
  • Add tests for NumPy evaluation, PyTorch differentiability, mixed NumPy/tensor inputs, loss usage and input validation

This PR intentionally does not modify the autoencoder classes yet. A follow-up PR can add convenience methods to the autoencoder API that call these shared metrics internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant