module documentation

Various tools for interfacing with the AN-simulations and more

Function as_torch_type Get torch datatype from string
Function get_freq_vect No summary
Function get_sampling_frequency No summary
Function get_tensor_from_h5py_numpy Get torch.Tensor from h5py data array
Function historize Takes a 2D or 3D tensor and bins along the time axis. If the tensor is 2D, the dimensions should be [frequency, time] If the tensor is 3D, the dimensions should be [channels, frequency, time]
Function open_an_simulation_data Undocumented
def as_torch_type(type_string): (source)

Get torch datatype from string

Parameters
type_string:strstring version of a datatype, e.g. 'int32'
Returns
torch.dtypetorch.dtype
def get_freq_vect(mat): (source)
Parameters
matAN-simulation structure (read from h5py)
Returns
def get_sampling_frequency(mat): (source)
Parameters
matAN-simulation structure (read from h5py)
Returns
int
def get_tensor_from_h5py_numpy(x, dtype): (source)

Get torch.Tensor from h5py data array

Parameters
xinput data
dtypetarget datatype
Returns
torch.Tensor
def historize(data, bin_width=1): (source)

Takes a 2D or 3D tensor and bins along the time axis. If the tensor is 2D, the dimensions should be [frequency, time] If the tensor is 3D, the dimensions should be [channels, frequency, time]

Parameters
data:torch.Tensorinput data
bin_width:intbin width in samples
Returns
torch.Tensortorch.Tensor
def open_an_simulation_data(fp, mode='r'): (source)

Undocumented

Returns
h5py.FileUndocumented