-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,163 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
This module contains exceptions to be raised in kliff modules, along with details on | ||
where they are raised. | ||
""" | ||
|
||
|
||
class TrainerError(Exception): | ||
""" | ||
Exceptions to be raised in Trainer and associated classes. | ||
""" | ||
|
||
def __init__(self, message): | ||
super().__init__(message) | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .kim_trainer import KIMTrainer | ||
from .kliff_trainer import Trainer | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Any, Dict | ||
|
||
import numpy as np | ||
|
||
|
||
def MSE_residuals( | ||
predictions: np.ndarray, | ||
targets: np.ndarray, | ||
) -> np.ndarray: | ||
r""" | ||
Compute the mean squared error (MSE) of the residuals. | ||
Args: | ||
Returns: | ||
The MSE of the residuals. | ||
""" | ||
residuals = predictions - targets | ||
return np.mean(residuals**2) | ||
Oops, something went wrong.