Skip to content

Refactor patched synapse #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ngclearn/components/synapses/patched/hebbianPatchedSynapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class HebbianPatchedSynapse(PatchedSynapse):
shape: tuple specifying shape of this synaptic cable (usually a 2-tuple
with number of inputs by number of outputs)

n_sub_models: The number of submodels in each layer
n_sub_models: The number of submodels in each layer (Default: 1 similar functionality as DenseSynapse)

stride_shape: Stride shape of overlapping synaptic weight value matrix
(Default: (0, 0))
Expand Down Expand Up @@ -185,7 +185,7 @@ class HebbianPatchedSynapse(PatchedSynapse):
batch_size: the size of each mini batch
"""

def __init__(self, name, shape, n_sub_models, stride_shape=(0,0), eta=0., weight_init=None, bias_init=None,
def __init__(self, name, shape, n_sub_models=1, stride_shape=(0,0), eta=0., weight_init=None, bias_init=None,
w_mask=None, w_bound=1., is_nonnegative=False, prior=(None, 0.), sign_value=1.,
optim_type="sgd", pre_wght=1., post_wght=1., p_conn=1.,
resist_scale=1., batch_size=1, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions ngclearn/components/synapses/patched/patchedSynapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PatchedSynapse(JaxComponent): ## base patched synaptic cable
shape: tuple specifying shape of this synaptic cable (usually a 2-tuple
with number of inputs by number of outputs)

n_sub_models: The number of submodels in each layer
n_sub_models: The number of submodels in each layer (Default: 1 similar functionality as DenseSynapse)

stride_shape: Stride shape of overlapping synaptic weight value matrix
(Default: (0, 0))
Expand All @@ -92,7 +92,7 @@ class PatchedSynapse(JaxComponent): ## base patched synaptic cable
this to < 1. will result in a sparser synaptic structure
"""

def __init__(self, name, shape, n_sub_models, stride_shape=(0,0), w_mask=None, weight_init=None, bias_init=None,
def __init__(self, name, shape, n_sub_models=1, stride_shape=(0,0), w_mask=None, weight_init=None, bias_init=None,
resist_scale=1., p_conn=1., batch_size=1, **kwargs):
super().__init__(name, **kwargs)

Expand Down