peal.sparse_dictionaries.batch_topk_network.ActivationStore¶
- class peal.sparse_dictionaries.batch_topk_network.ActivationStore[source]¶
Bases:
objectMinimal
next_batch()source over an in-memory activation tensor.The trainer pulls batches from an object with a
next_batchmethod; this adapter serves consecutive slices ofXand wraps around at the end.- Parameters:
config (
dictorobject) – Wherebatch_size(ormodel_batch_size) anddeviceare read from; a pydantic config is inspected through itscfgdict.X (
torch.Tensor) – Activations of shape(n, act_size).
Methods
Return the next
(batch_size, act_size)slice moved todevice.