import sparselab
layer = sparselab.SparseLinear(1536, 384, sparsity=0.9)
algo = sparselab.RigL(sparsity=0.9, drop_fraction=0.3, update_freq=100)
layer.apply(algo) # mutates topology during training
SparsityAlgorithm is modeled on Cerebras's SparsityAlgorithm API (https://training-api.cerebras.ai/en/latest/wsc/tutorials/spa...) and credited in the docstrings. v0.1 ships Static, SET, and RigL.