-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added util function to generate Poisson Spike Train based on value ve…
…ctor
- Loading branch information
1 parent
c85bfd5
commit b550487
Showing
4 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
poissonST(l::AbstractVector) | ||
Generates Poisson Spike Trains based on the normalized vector. Each | ||
pseudo-neuron (probability p in vector), fires with probability p at each | ||
timestep of simulation. | ||
# Inputs | ||
- `l`: array of values | ||
""" | ||
|
||
function poissonST(l::AbstractVector) | ||
return poissonST(t) = [Float64(rand(Bernoulli(p), 1)[1]) for p in normalize(l)] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Various useful utility functions | ||
# Various useful utility functions | ||
|
||
include("utilities/utils.jl") | ||
|
||
# A pruning framework to remove neurons from Networks and Layers | ||
include("utilities/pruning.jl") | ||
include("utilities/pruning.jl") | ||
|
||
include("utilities/poisson.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters