Comments (6)
Random number generators rand() and randn() are now working as expected I believe. Subject to more testing.
BinomialFunction could also be done but I am unsure about where to put the code. So far BinomialFunction is defined in brian2.input.binomial. If I just ad the genn implementation there alongside the other implementations (in the BinomialFunction.init function) that would work but introduce a dependency of Brian2 on Brian2GeNN. That's probably not what we want. But how else to add the genn implementation? Do you have a view how one would best add additional implementations for BinomialFunction @mstimberg ?
from brian2genn.
I don't see any good way to make this work at the moment, unfortunately. I filed an issue for it, it should only need a bit of refactoring in Brian2 : brian-team/brian2#542.
As a short term solution you could add a GeNNBinomialFunction
class, but of course that will not be automatically used by PoissonInput
. But then again, PoissonInput
is just a convenience wrapper around creating a binomial function object and calling a run_regularly
operation on the group with target_var += binomial()*weight
.
from brian2genn.
If BinomialFunction implementations were hanging around in something like DEFAULT_FUNCTIONS then it would be very easy.
from brian2genn.
The problem is that there's not one implementation as for other functions. You use BinomialFunction
like:
binomial = BinomialFunction(n=1000, p=0.01)
G = NeuronGroup(...)
G.run_regularly('v += binomial()*0.1')
From Brian's point of view, each BinomialFunction
instance will be a separate function with separate implementation. But it's not terribly complicated, after the refactoring for brian-team/brian2#542 you'll have to do something like:
def genn_code_for_binomial(n, p, use_approximation=True):
# ...
BinomialFunction.code_generators[GeNNCodeObject] = genn_code_for_binomial
from brian2genn.
Oh - I see: The different n and p. What you propose sounds like a good plan. I will have the code ready once this is done.
from brian2genn.
Binomial function now working I believe. Moving on.
from brian2genn.
Related Issues (20)
- Question: How to work around restriction of synaptic output variable or summed variable? HOT 4
- Cannot open include file: 'brianlib/stdint_compat.h from clocks.h HOT 22
- Building genn executable fails after a certain number of successful runs when parameter fitting HOT 12
- Workaround for network-operation? HOT 30
- Use GeNN's new run_regularly mechanisms for run_regularly statements
- Use GeNN's initvar snippets for synapse creation
- Brian2genn model build is completed, but system cannot find the path specified HOT 17
- RuntimeError: Project compilation failed HOT 2
- Undeclared Identifier Error for Multiple Runs HOT 6
- potential problem with handling of build_options
- Custom header files are missing when used in `device.insert_code` calls HOT 1
- C99 math functions fail on integer type arguments HOT 18
- Inaccurate updates when having multiple differential equations in neuron groups HOT 3
- StateMonitor fails to collect data from some Synapses HOT 3
- use individually named dir instead of GeNNworkspace HOT 1
- [Feature request] Support for slower clocks in Monitors HOT 3
- RNG & seeding HOT 4
- SpikeGenerator problem HOT 2
- Error code 50 HOT 3
- Failed to build, error: ‘spikeCount_neurongroup’ was not declared in this scope HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brian2genn.