braindecode package

Subpackages

Submodules

braindecode.util module

braindecode.util.corr(a, b)[source]

Computes correlation only between terms of a and terms of b, not within a and b.

Parameters:a, b (2darray, features x samples)
Returns:
Return type:Correlation between features in x and features in y
braindecode.util.cov(a, b)[source]

Computes covariance only between terms of a and terms of b, not within a and b.

Parameters:a, b (2darray, features x samples)
Returns:
Return type:Covariance between features in x and features in y
braindecode.util.wrap_reshape_apply_fn(stat_fn, a, b, axis_a, axis_b)[source]

Reshape two nd-arrays into 2d-arrays, apply function and reshape result back.

Parameters:
  • stat_fn (function) – Function to apply to 2d-arrays
  • a (nd-array: nd-array)
  • b (nd-array)
  • axis_a (int or list of int) – sample axis
  • axis_b (int or list of int) – sample axis
Returns:

result – The result reshaped to remaining_dims_a + remaining_dims_b

Return type:

nd-array

class braindecode.util.FuncAndArgs(func, *args, **kwargs)[source]

Bases: object

Container for a function and its arguments. Useful in case you want to pass a function and its arguments to another function without creating a new class. You can call the new instance either with the apply method or the ()-call operator:

>>> FuncAndArgs(max, 2,3).apply(4)
4
>>> FuncAndArgs(max, 2,3)(4)
4
>>> FuncAndArgs(sum, [3,4])(8)
15
apply(*other_args, **other_kwargs)[source]
braindecode.util.add_message_to_exception(exc, additional_message)[source]
braindecode.util.dict_compare(d1, d2)[source]

From http://stackoverflow.com/a/18860653/1469195

braindecode.util.dict_equal(d1, d2)[source]
braindecode.util.dict_is_subset(d1, d2)[source]
braindecode.util.merge_dicts(*dict_args)[source]

Given any number of dicts, shallow copy and merge into a new dict, precedence goes to key value pairs in latter dicts. http://stackoverflow.com/a/26853961

braindecode.util.touch_file(path)[source]
braindecode.util.to_tuple(sequence_or_element, length=None)[source]
braindecode.util.mkdir_p(path)[source]
braindecode.util.select_inverse_inds(arr, inds)[source]

braindecode.version module