Skip to content

Commit 7510bb3

Browse files
authored
model_utils and rate cell (#70)
* Patched synapses added * Update __init__.py * Update patch_utils.py patch_with_stride & patch_with_overlap functions + Create_Patches class added * Update patchedSynapse.py * Update hebbianPatchedSynapse.py * Update synapse_plot.py order added * Create hierarchical_sc.md 1 * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update sparse_coding.md * Update sparse_coding.md * Update sparse_coding.md * Update sparse_coding.md * Update hierarchical_sc.md * Update sparse_coding.md * Update sparse_coding.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Add files via upload * Delete docs/images/hgpc_network.pdf * Add files via upload * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Create hgpc * Delete docs/images/museum/hgpc * Create d * Add files via upload * Delete docs/images/hgpc_model.png * Delete docs/images/museum/hgpc/d * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Add files via upload * Update hierarchical_sc.md * Update hierarchical_sc.md * Delete docs/images/museum/hgpc/Input_layer.png * Add files via upload * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Update hierarchical_sc.md * Create Generative_PC.md * Update and rename Generative_PC.md to generative_pc.md * Update generative_pc.md * Update generative_pc.md * Update model_utils.py * Update model_utils.py * Update model_utils.py * Update model_utils.py * Update rateCell.py * Update generative_pc.md * Create pc-sindy.md * Update pc-sindy.md * Update model_utils.py sine activation function added * Update model_utils.py * Update ode_utils.py jitified * Delete docs/museum/hierarchical_sc.md * Delete docs/museum/generative_pc.md * Delete ngclearn/components/synapses/patched directory * Update __init__.py * Add files via upload ode with scanner added * Update ode_solver.py _ removed
1 parent da439bd commit 7510bb3

File tree

14 files changed

+414
-523
lines changed

14 files changed

+414
-523
lines changed
13.5 MB
Loading
190 KB
Loading
19 MB
Loading

docs/museum/pc-sindy.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Sparse Identification of Non-linear Dynamical Systems with Predictive Coding (PC-SINDy)
2+
3+
In this section, we teach, create, simulate, and visualize SINDy model with Predictive Coding (PC-SINDy) using NGC-Learn library components.
4+
5+
6+
7+
8+
9+
10+
11+
The model **code** for this exhibit can be found [here](https://github.com/NACLab/pc_sindy.py).
12+
13+
14+
## Predictive Coding (PC)
15+
PC is a biological plausible learning algorithm that learns the effective representation and transformations from the data.
16+
17+
18+
## Sparse Identification of Non-linear Dynamical Systems (SINDy)
19+
SINDy is a data-driven algorithm that finds the derivative of dynamical systems in terms of a symbolic equation of the system's state vector.
20+
SINDy describes the derivative (linear operation acting on △t) as linear transformations
21+
of a manually constructed dictionary from the state vector by a coefficient matrix.
22+
Dictionary learning combined with LASSO (L1-norm) promotes the sparsity of the coefficient matrix
23+
which allows only governing terms in the dictionary stay non-zero.
24+
25+
Learning the
26+
27+
28+
## SINDy with Predictive Coding
29+
30+
<p align="center">
31+
<img src="" width="550" title="">
32+
</p>
33+
34+
## Predictive Coding Model Dynamics

docs/museum/sparse_coding.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $$
6868

6969
where we see that we aim to learn a two-layer generative system that specifically
7070
imposes a prior distribution `p(z)` over the latent feature detectors (via the
71-
constraint function $\Omega\big(\mathbf{z}(t)\big)$) that we hope
71+
constraint function $ \Omega\big(\mathbf{z}(t)\big) $ ) that we hope
7272
to extract in node `z`. Note that this two-layer model (or single latent-variable layer
7373
model) could either be the linear generative model from <b>[1]</b> or one similar to the
7474
model learned through ISTA <b>[2]</b> if a (soft) thresholding function is used instead.

ngclearn/components/neurons/graded/rateCell.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ def __init__(self, name, n_units, tau_m, prior=("gaussian", 0.), act_fx="identit
177177
self.shape = shape
178178
self.n_units = n_units
179179
self.batch_size = batch_size
180-
self.fx, self.dfx = create_function(fun_name=act_fx)
180+
181+
182+
omega_0 = None
183+
if act_fx == "sine":
184+
omega_0 = kwargs["omega_0"]
185+
self.fx, self.dfx = create_function(fun_name=act_fx, args=omega_0)
181186

182187
# compartments (state of the cell & parameters will be updated through stateless calls)
183188
restVals = jnp.zeros(_shape)

ngclearn/components/synapses/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
## modulated synaptic components
2222
from .modulated.MSTDPETSynapse import MSTDPETSynapse
2323
## patched synaptic components
24-
from .patched.patchedSynapse import PatchedSynapse
25-
from .patched.staticPatchedSynapse import StaticPatchedSynapse
26-
from .patched.hebbianPatchedSynapse import HebbianPatchedSynapse
24+
## from .patched.patchedSynapse import PatchedSynapse
25+
## from .patched.staticPatchedSynapse import StaticPatchedSynapse
26+
## from .patched.hebbianPatchedSynapse import HebbianPatchedSynapse

ngclearn/components/synapses/patched/hebbianPatchedSynapse.py

-316
This file was deleted.

0 commit comments

Comments
 (0)