Utils
assert_matrix_correlation_above_value(actual, expected, mask=None, min_correlation=0.95, msg='')
Assert that two tensors are close with a root mean squared error (RMSE) relative to the scaled root mean square values for each matrix. This tells you if the RMSE implies that the two matrices are more similar to eachother as-is than would be the case if values were randomly permuted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actual
|
Tensor
|
The actual tensor. |
required |
expected
|
Tensor
|
The expected tensor. |
required |
mask
|
Optional[Tensor]
|
If there are only some values you want to compare, apply this mask and RMSE will be computed on the unmasked items only. |
None
|
min_relative_rmse
|
The relative tolerance parameter. |
required |
Source code in bionemo/testing/utils.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
assert_matrix_mape_below_value(actual, expected, mask=None, max_mape=0.1, eps=0.001, msg='')
Assert that two tensors are close with a root mean squared error (RMSE) relative to the scaled root mean square values for each matrix. This tells you if the RMSE implies that the two matrices are more similar to eachother as-is than would be the case if values were randomly permuted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actual
|
Tensor
|
The actual tensor. |
required |
expected
|
Tensor
|
The expected tensor. |
required |
mask
|
Optional[Tensor]
|
If there are only some values you want to compare, apply this mask and RMSE will be computed on the unmasked items only. |
None
|
min_relative_rmse
|
The relative tolerance parameter. |
required |
Source code in bionemo/testing/utils.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|