CachedDataset2

class CachedDataset2.CachedDataset2(**kwargs)[source]

Somewhat like CachedDataset, but different. Simpler in some sense. And more generic. Caching might be worse.

If you derive from this class: - you must override _collect_single_seq - you must set num_inputs (dense-dim of “data” key) and num_outputs (dict key -> dim, ndim-1) - you should set labels - handle seq ordering by overriding init_seq_order - you can set _estimated_num_seqs - you can set _num_seqs or _num_timesteps if you know them in advance

init_seq_order(epoch=None, seq_list=None)[source]
Parameters:| None seq_list (list[str]) – In case we want to set a predefined order.

This is called when we start a new epoch, or at initialization. Call this when you reset the seq list.

is_cached(start, end)[source]
num_seqs[source]
is_less_than_num_seqs(n)[source]
get_num_timesteps()[source]
get_seq_length(sorted_seq_idx)[source]
Return type:int
get_input_data(sorted_seq_idx)[source]
get_targets(target, sorted_seq_idx)[source]
get_ctc_targets(sorted_seq_idx)[source]
get_tag(sorted_seq_idx)[source]
get_target_list()[source]
is_data_sparse(key)[source]
Return type:bool
get_data_dim(key)[source]
Return type:int
Returns:number of classes, no matter if sparse or not
get_data_dtype(key)[source]