tvachnad / neural-network Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Currently, it's using setInterval, which means that it's called every 20 seconds. But we only need to call it just once
Namely, in the simulation_page.html, can we just download anything like this one needed for logging: https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js and keep it in the vendor js folder, rather than get it every time?
Also, the main homepage is waayy to scripty for our minimal needs (sorry Cassie). We could accomplish the same with something vastly simpler than bootstrap.
For both of these, for example if we're at an ONR conference with no internet (they have high security and no wifi allowed), we want to be able to launch the simulation without needing to be online.
This is not feasible so we should check what are we doing wrongly.
Add this assert to spot the problem:
// if(n.astrocyte.availableEnergy<=astrocyte_settings.minEnergy)
// n.astrocyte.replenish();
}
assert(this.allSignals.length < this.allAxons.length);
if(this.logger != null){
if(this.logger.getLastEntry() >= 19){
this.logger.sendToServer();
Max signals and max axon distance are no longer relevant or accurate. Max neuron connections is also broke/invalid? On a related note, Master branch has had many menu terminology updates, and there might be a conflict during merge w/ the newly deleted menu options.
// update neurons state and release signal
for (ii = 0; ii < this.allNeurons.length; ii++) {
n = this.allNeurons[ii];
// the astrocyte we're taking energy from
if (n.receivedSignal) { // Astrocyte mode
if (n.fire() === true) {
var a = n.canFire();
if(a === true){
if(this.logger != null){
this.logger.addToLastEntry(ii+1);
this.logger2.addToLastEntry(n.acc+0.125);
}
a.deplete();
n.lastSignalRelease = currentTime;
this.releaseSignalAt(n);
} else if(a >= 0){
//log misssed activation astrocyte energy
}
}
}
To log the energy of the astrocyte when it didn't have enough energy to fire, but the neuron would have fired, the order of checking if the neuron will fire needs to change. First check if the neuron will fire, then check if the neuron can fire from the astrocyte. This also means changing the way that canFire() is defined. A helper function is also needed to return the value of the astrocyte.
this code:
//load connectivity matrix
d3.csv("./static/models/connectivity.csv", function(data) {
for(var q = 0;q<188;q++){
self.connectivityMatrix[q]=data[q];
}
});
is the code to load the connectivity matrix. The code that follows assume that when its run, the connectivity matrix is already loaded, but that is not true as d3.csv is asynchonous
The regeneration is not synced to the ticks that update the network but a clock on the users computer. This leads to the regeneration time getting out of sync with the simulation when the simulation slows down.
Proposing this change to the function to have it update when neuralNetwork.update() is called
NeuralNetwork.prototype.updateRegeneration = function(currentTime) {
var timeSinceLastUpdate = currentTime - this.lastRegenUpdate;
if(timeSinceLastUpdate >= astrocyte_settings.frequency){
astrocyte_settings.replenishEnergy += this.regenSign*astrocyte_settings.amplitude;
this.lastRegenUpdate = currentTime;
if(astrocyte_settings.replenishEnergy > astrocyte_settings.maxThreshold){
astrocyte_settings.replenishEnergy = astrocyte_settings.maxThreshold;
this.regenSign *= -1;
} else if(astrocyte_settings.replenishEnergy < astrocyte_settings.minThreshold){
astrocyte_settings.replenishEnergy = astrocyte_settings.minThreshold;
this.regenSign *= -1;
}
}
}
The Neuron.prototype.decay function isn't used and neurons only decay based on the decay function which use a timer. Need to make this depend on a tick based clock. Proposing this change where if a neuron doesn't receive a signal then it decays using the decay function:
Neuron.prototype.decay = function(){
this.acc = 0.9 * this.acc;
if (this.acc < 0)
this.acc = 0;
}
Neuron.prototype.fireIfCan = function(neuralNet, currentTime)
{
var ret = [false, null];
if (this.willFire())
{
if (this.receivedSignal) {
var astrocyte = this.astrocyteWithEnergy();
if (astrocyte != null) { // Astrocyte mode
var prevacc = this.acc;
this.fire();
ret = [true, prevacc]
astrocyte.deplete();
this.lastSignalRelease = currentTime;
neuralNet.releaseSignalAt(this);
} else {
ret = [false, this.astrocyte.availableEnergy];
}
this.receivedSignal = false; // if neuron received signal but still in delay reset it
} else {
this.decay();
}
}
return ret;
}
We want to log the total amount of available energy and the number of non empty energy pools
The ajax code to handle logging expects json data but success is raw text.
The homepage links to the wrong simulation page, and neither seems to be displaying content as before.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.