Skip to content

Commit

Permalink
Merge pull request #90 from ggmarshall/main
Browse files Browse the repository at this point in the history
Ml processors for ann
  • Loading branch information
iguinn authored Oct 21, 2024
2 parents 6d226a2 + 2b49f11 commit f83c184
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dspeed/processing_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,11 @@ def _loadlh5(path_to_file, path_in_file: str) -> np.array: # noqa: N805
"""

try:
loaded_data = sto.read(path_in_file, path_to_file)[0].nda
loaded_data = sto.read(path_in_file, path_to_file)[0]
if isinstance(loaded_data, lgdo.types.Scalar):
loaded_data = loaded_data.value
else:
loaded_data = loaded_data.nda
except ValueError:
raise ProcessingChainError(f"LH5 file not found: {path_to_file}")

Expand Down
12 changes: 12 additions & 0 deletions src/dspeed/processors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
from .linear_slope_fit import linear_slope_diff, linear_slope_fit
from .log_check import log_check
from .min_max import min_max, min_max_norm
from .ml import (
classification_layer_no_bias,
classification_layer_with_bias,
dense_layer_no_bias,
dense_layer_with_bias,
normalisation_layer,
)
from .moving_windows import (
avg_current,
moving_window_left,
Expand Down Expand Up @@ -179,4 +186,9 @@
"convolve_exp",
"convolve_damped_oscillator",
"inject_damped_oscillation",
"dense_layer_no_bias",
"dense_layer_with_bias",
"classification_layer_no_bias",
"classification_layer_with_bias",
"normalisation_layer",
]
Loading

0 comments on commit f83c184

Please sign in to comment.