-
Notifications
You must be signed in to change notification settings - Fork 21
Design Review 1: KLIFF Trainer framework #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
9108450
2dc9be0
731c5df
86ab5d2
2f57f56
01322ec
2fa8bb8
e1ef24e
614c1b9
d3050a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .kim_trainer import KIMTrainer | ||
from .kliff_trainer import Trainer |
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( | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can port residuals at Line 36 in 038c990
Need to think about whether we want to support normalization and such in the residual function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will return to this later, keeping the comment unresolved for reference. |
||||
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) |
Uh oh!
There was an error while loading. Please reload this page.