try_signalling's People
try_signalling's Issues
consider RunningSet::new by "moving the var out & in".
benefit:
- avoid network communication between original data & running thread caused by the mechanism of Mutex.
- keep RunningSet::new simple (not adding more functions when having more run-modes), i.e. let the "body" (where the soul can go out & in) generate closure & insert into RunningSet.
Phase Respond should be removed for better performance.
Phase Respond should be removed for better performance.
It's no necessary for practical SNN operation. the signals are always timed.
Should deprecate Runnable
Should deprecate Runnable to remove redundancy.
avoid redundant type annotation for connections
can try associated type.
pub trait PassiveConnection<S0: Send, S1: Send>
to
pub trait PassiveConnection {type S0; type S1;}
pub type ConnectionComponentS1<G, A> = ConnectionComponent<G, A, FwdPreS1, FwdPostS1>;
to
pub type ConnectionComponentS1<G, A> = ConnectionComponent<Generator<S0=FwdPreS1>, Acceptor<S1=FwdPostS1>>;
pub struct ConnectionComponent<G: Send + ?Sized, A: Send + ?Sized, R: Send, S: Send>
to
pub struct ConnectionComponent<G: Generator + Send + ?Sized, A: Acceptor + Send + ?Sizedd>
Need types of connections of an agent be organized into a Vec of connection-populations
Reason: to run the loop in Supervisor for generating threads for all connections.
Ideas:
Pub Struct Model { oub_connection_populations: Vec<Vec<out_connection_population_of_some type>> }
let connection_population hold Arc of agent_populations
let connection_population hold Arc of agent_populations to simplify the the system be managed based on populations.
synapses must config_channels before all neurons.
synapses need to check the mode of pre & post synapse neuron to decide whether to run.
Therefore, if some neurons config_channels before synapses,
those neurons may get signal channels which the correspondent synapses won't run.
passive_sync_chs_sets may be locked by passive_running_populations
due to the need to access the Passive Agents, passive_sync_chs_sets may be locked by passive_running_populations.
Possible solutions:
- let OutCoponents hold passive_sync_chs_sets when config_channels.
- not use Mutex anymore; make a copy (like phantom) when run then merge back after running.
- let passive_running_sets wait some time. (not really fix the problem.)
- get sync_chs_sets by message passing.....!? seems don't work...
ffw_accepted return type
should ffw_accepted return Iter or Vec?
need functionality to add/remove agent/connection
need functionality to add/remove agent/connection
more connection possibilities to be implemented
Active_Multi_Out to Active_Multi_Out not implemented yet:
need modify Multi_In/Out_Component.
SingleOut to PassiveSingleOut not implemented yet:
need modify Single_In/Out_Component & passive_device run().
supervisor should use Weak to hold populations?
supervisor should use Weak to hold populations?
let a agent able to be owned by multi population
let a agent able to be owned by multi population,
and not cause problems when config_run from multi populations.
need the functionality of "address"
let everything know who & where it is.
by some String?
e.g. "Supervisor-0, LIF_population-1, #100."
Consider using Actor Model
Consider using actor model for performance / distributed run / avoiding complicated error handling when config.
fore-agents should only send signals to the "configured" back-agents.
in real situation, agents in a network may or may not be configured for running,
and running fore-agents should not send signals to the idle back-agents.
agent_component should avoid re-make the whole vec of connections when mode switching
PreComponent should be:
{connections: Vec<(Arc<Mutex<Conn>>, DeviceMode<channels>)>}
passive running set of neurons should be separated by types of signals
passive running set of neurons should be separated by types of signals.
in case that a neuron can have different actions to types of acceptors when firing, this feature can avoid redundant message passing of confirm/report.
There should be a enum GeneratedSignal of types of signals a neuron has.
the running set of neurons should be hashtable of GeneratedSignal-acceptor_group,
device.evolve should return a vector/iterator of GeneratedSignal,
the device.run use it to decide which groups need Broadcast::FinishCycle.
avoid complicated objects design of shared channels-carrier.
candidates:
- message passing.
- fully reframed to actor model. #24
loosen the type restriction on Connections in Vec of agent_components
pub struct ComponentIdle<C, S0, S1> where C: PassiveConnection<S0, S1> + Send + ?Sized, { connections: Vec<Weak<Mutex<C>>>, }
to
Inlet<S0> & Outlet<S1>
respectively for post/pre components.
Need some way to avoid duplicate similar code of agent's init running connections.
`{
code below
code below
code below
// here
fn run(&mut self, rx_confirm: CCReceiver, tx_report: CCSender) {
let mut running_connections = Vec::new();
for conn in &self.out_connections_1 {
let running_conn = conn.connection.upgrade().unwrap();
let (tx_conn_report, rx_conn_report) = crossbeam_channel::bounded(1);
let (tx_conn_confirm, rx_conn_confirm) = crossbeam_channel::bounded(1);
running_connections.push(RunningSet {
instance: thread::spawn(move || {running_conn.lock().unwrap()
.run_under_agent(rx_conn_confirm, tx_conn_report)}),
report: rx_conn_report,
confirm: tx_conn_confirm,
});
}
// failed to use a function of init_connections
for conn in &self.out_connections_2 {
let running_conn = conn.connection.upgrade().unwrap();
let (tx_conn_report, rx_conn_report) = crossbeam_channel::bounded(1);
let (tx_conn_confirm, rx_conn_confirm) = crossbeam_channel::bounded(1);
running_connections.push(RunningSet {
instance: thread::spawn(move || {running_conn.lock().unwrap()
.run_under_agent(rx_conn_confirm, tx_conn_report)}),
report: rx_conn_report,
confirm: tx_conn_confirm,
});
}`
neurons should also check whether it has any passive acceptors for Firing::N/Y
neurons should also check whether it has any passive acceptors for Firing::N/Y.
If it connected to no passive acceptors, then even if it fires, it has to to nothing in FinishCycle phase.
supervisor's ownership to populations should be Weak
supervisor's ownership to populations should be Weak.
need functionality of display network information under 2 modes.
1 is population level: show the relationships between populations,
e.g. neuron-population-0 all-to-all neuron-population-1.
1 is device level,
e.g. neuron-population-0, device # 1, connect to :
connection-population-0, device # 10,
recorder-population-0, device # 1,
modify connection.new() 's argument as &Arc<...>
to avoid writing Arc::clone(&some_agent) for convenience.
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.