- added train
- refactored CdTrain
This commit is contained in:
@@ -14,3 +14,12 @@ def sample(src: np.ndarray) -> np.ndarray:
|
||||
|
||||
def prob(src: np.ndarray) -> np.ndarray:
|
||||
return 1.0 / (1 + np.exp(-src))
|
||||
|
||||
def rms_error(d_err: np.ndarray):
|
||||
d_err_squared = d_err % d_err
|
||||
return np.sum(d_err_squared, 1) / d_err_squared[1]
|
||||
|
||||
def rms_error_accu(d_err: np.ndarray):
|
||||
d_err_squared = d_err % d_err
|
||||
return np.cumsum(d_err_squared) / d_err_squared[1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user