Skip to content

Commit

Permalink
update __init__s to use __all__ and make all module functionality ava…
Browse files Browse the repository at this point in the history
…ilable
  • Loading branch information
belsten authored and belsten committed Nov 28, 2024
1 parent a7286fb commit 49fc383
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
46 changes: 41 additions & 5 deletions sparsecoding/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
"Modules for sparse coding."
from .models import SparseCoding
from .inference import LCA, IHT, ISTA, LSM, MP, OMP, Vanilla, PyTorchOptimizer
from .visualization import plot_dictionary, plot_patches
from .priors import SpikeSlabPrior, L0Prior
from .datasets import BarsDataset, FieldDataset
from .dictionaries import (
load_dictionary_from_pickle,
load_bars_dictionary,
load_olshausen_dictionary,
)

from . import models
from . import inference
from . import visualization
from . import priors
__all__ = [
# Models
"SparseCoding",

# Inference
"LCA",
"IHT",
"ISTA",
"LSM",
"MP",
"OMP",
"Vanilla",
"PyTorchOptimizer",

# Visualization
"plot_dictionary",
"plot_patches",

# Priors
"SpikeSlabPrior",
"L0Prior",

# Dictionaries
"load_dictionary_from_pickle",
"load_bars_dictionary",
"load_olshausen_dictionary",

# Datasets
"BarsDataset",
"FieldDataset",
]
14 changes: 12 additions & 2 deletions sparsecoding/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
from . import patch
from . import whiten
from .patch import sample_random_patches, patchify, quilt
from .whiten import Whitener

__all__ = [
# From patch module
"sample_random_patches",
"patchify",
"quilt",

# From whiten module
"Whitener",
]

0 comments on commit 49fc383

Please sign in to comment.