| import numpy as np | |
| from reproduction.gpu_reproduction import summarize_sample_outputs | |
| def test_sample_summary_reports_bias_variance_and_fidelity(): | |
| reference = np.array([1.0, 2.0, -1.0]) | |
| samples = np.array( | |
| [ | |
| [1.0, 2.0, -1.0], | |
| [1.2, 1.8, -0.8], | |
| [0.8, 2.2, -1.2], | |
| ] | |
| ) | |
| summary = summarize_sample_outputs(samples, reference) | |
| np.testing.assert_allclose(summary["bias_relative_l2"], 0.0, atol=1e-15) | |
| assert summary["mean_relative_l2"] > 0 | |
| assert summary["mean_cosine_similarity"] < 1.0 | |
| assert summary["empirical_mse_trace"] > 0 | |