Fourier nRMSE¤
exponax.metrics.fourier_nRMSE
¤
fourier_nRMSE(
u_pred: Float[Array, "C ... N"],
u_ref: Float[Array, "C ... N"],
*,
low: Optional[int] = None,
high: Optional[int] = None,
eps: float = 1e-05
) -> float
Compute the normalized root mean squared error (nRMSE) between two fields in Fourier space.
Arguments:
u_pred
(array): The first field to be used in the error computation.u_ref
(array): The second field to be used in the error computation.low
(int, optional): The low-pass filter cutoff. Default is 0.high
(int, optional): The high-pass filter cutoff. Default is the Nyquist frequency.eps
(float, optional): Small value to avoid division by zero and to remove numerical rounding artiacts from the FFT. Default is 1e-5.
Returns:
nrmse
(float): The normalized root mean squared error between the fields
Source code in exponax/_metrics.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
|
exponax.metrics.mean_fourier_nRMSE
¤
mean_fourier_nRMSE(
u_pred: Float[Array, "B C ... N"],
u_ref: Float[Array, "B C ... N"],
*,
low: Optional[int] = None,
high: Optional[int] = None,
eps: float = 1e-05
) -> float
Compute the mean nRMSE between two fields in Fourier space. Use this function to correctly operate on arrays with a batch axis.
Arguments:
u_pred
(array): The first field to be used in the error computation.u_ref
(array): The second field to be used in the error computation.low
(int, optional): The low-pass filter cutoff. Default is 0.high
(int, optional): The high-pass filter cutoff. Default is the Nyquist frequency.eps
(float, optional): Small value to avoid division by zero and to remove numerical rounding artiacts from the FFT. Default is 1e-5.
Returns:
mean_nrmse
(float): The mean normalized root mean squared error between the fields
Source code in exponax/_metrics.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
|
exponax.metrics._fourier_nRMSE
¤
_fourier_nRMSE(
u_pred: Float[Array, "... N"],
u_ref: Float[Array, "... N"],
*,
low: Optional[int] = None,
high: Optional[int] = None,
num_spatial_dims: Optional[int] = None,
eps: float = 1e-05
) -> float
Low-level function to compute the normalized root mean squared error (nRMSE) between two fields in Fourier space.
If num_spatial_dims
is not provided, it will be inferred from the shape of
the input fields. Please adjust this argument if you call this function with
an array that also contains channels (even for arrays with singleton
channels).
Arguments:
u_pred
(array): The first field to be used in the error computation.u_ref
(array): The second field to be used in the error computation.low
(int, optional): The low-pass filter cutoff. Default is 0.high
(int, optional): The high-pass filter cutoff. Default is the Nyquist frequency.num_spatial_dims
(int, optional): The number of spatial dimensions in the field. IfNone
, it will be inferred from the shape of the input fields and then is the number of axes present. Default isNone
.eps
(float, optional): Small value to avoid division by zero and to remove numerical rounding artiacts from the FFT. Default is 1e-5.
Source code in exponax/_metrics.py
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
|