Skip to content

Commit

Permalink
fix array of ragged sequences in scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanJamesLew committed Mar 21, 2024
1 parent 02ba932 commit 50a96f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autokoopman/core/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def weighted_score(

absdiff = (prediction_data - true_data).abs()
end_errors = np.array(
[norm(weights_f[n] * s.states, axis=1) for n, s in absdiff._trajs.items()]
[norm(weights_f[n] * s.states, axis=1) for n, s in absdiff._trajs.items()],
dtype=object,
)
return np.sum(np.concatenate(end_errors, axis=0))

Expand All @@ -43,7 +44,7 @@ def end_point_score(true_data: TrajectoriesData, prediction_data: TrajectoriesDa
@staticmethod
def total_score(true_data: TrajectoriesData, prediction_data: TrajectoriesData):
errors = (prediction_data - true_data).norm()
end_errors = np.array([s.states.flatten() for s in errors])
end_errors = np.array([s.states.flatten() for s in errors], dtype=object)
return np.mean(np.concatenate(end_errors, axis=0))

@staticmethod
Expand Down

0 comments on commit 50a96f1

Please sign in to comment.