-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit to the repository, paper included in readme.
Authored by: @LiveBacteria (Tyler Poore) Major functionality of the theory integration has been omitted as of this time. As such, later commits will contain the files as the theory is completed.
- Loading branch information
0 parents
commit 0197b4a
Showing
15 changed files
with
5,886 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
node_modules | ||
.vscode | ||
vis/__pycache__ | ||
vis/neural_mesh | ||
vis/octants | ||
vis/adjacencyMap.json | ||
vis/data.json | ||
vis/test.py | ||
vis/progress.txt | ||
vis/visualise.py_old | ||
trace32.exe | ||
scratch | ||
progress.txt | ||
adjacencyMap.json | ||
kdTree.js | ||
kdtreeTest.js | ||
nMesh.json_old | ||
pineconeTest.js | ||
cudaTest.js | ||
.env |
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,79 @@ | ||
class Neuron { | ||
constructor() { | ||
this.connections = []; | ||
this.value = Math.random(); | ||
this.weight = Math.random(); | ||
} | ||
|
||
connectTo(neuron) { | ||
this.connections.push(neuron); | ||
} | ||
} | ||
|
||
class Superposition { | ||
constructor(neurons) { | ||
this.neurons = neurons; | ||
this.position = this.calculatePosition(); | ||
} | ||
|
||
calculatePosition() { | ||
let x = 0; | ||
let y = 0; | ||
let z = 0; | ||
|
||
for (let neuron of this.neurons) { | ||
x += neuron.x; | ||
y += neuron.y; | ||
z += neuron.z; | ||
} | ||
|
||
return { | ||
x: x / this.neurons.length, | ||
y: y / this.neurons.length, | ||
z: z / this.neurons.length, | ||
}; | ||
} | ||
} | ||
|
||
class NeuralNetwork { | ||
constructor(size) { | ||
this.size = size; | ||
this.neurons = this.createNeurons(); | ||
this.superpositions = []; | ||
} | ||
|
||
createNeurons() { | ||
let neurons = []; | ||
for (let i = 0; i < this.size; i++) { | ||
for (let j = 0; j < this.size; j++) { | ||
for (let k = 0; k < this.size; k++) { | ||
let neuron = new Neuron(); | ||
neuron.x = i; | ||
neuron.y = j; | ||
neuron.z = k; | ||
neurons.push(neuron); | ||
} | ||
} | ||
} | ||
return neurons; | ||
} | ||
|
||
activateRandomNeurons(percentage) { | ||
let numToActivate = Math.floor(this.neurons.length * percentage); | ||
for (let i = 0; i < numToActivate; i++) { | ||
let neuron = | ||
this.neurons[Math.floor(Math.random() * this.neurons.length)]; | ||
neuron.value = 1; | ||
} | ||
} | ||
|
||
createSuperposition() { | ||
let activatedNe V+9urons = this.neurons.filter((neuron) => neuron.value === 1); | ||
let superposition = new Superposition(activatedNeurons); | ||
this.superpositions.push(superposition); | ||
} | ||
} | ||
|
||
let neuralNetwork = new NeuralNetwork(20); | ||
neuralNetwork.activateRandomNeurons(0.05); | ||
neuralNetwork.createSuperposition(); |
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,35 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const math = require("mathjs"); | ||
|
||
class Neuron { | ||
constructor(x, y, z) { | ||
this.x = x; | ||
this.y = y; | ||
this.z = z; | ||
} | ||
} | ||
|
||
process.on( | ||
"message", | ||
({ centerX, centerY, centerZ, neuronsPerProcess, filename }) => { | ||
// Create the directory if it doesn't exist | ||
let dir = path.dirname(filename); | ||
if (!fs.existsSync(dir)) { | ||
fs.mkdirSync(dir, { recursive: true }); | ||
} | ||
|
||
let writeStream = fs.createWriteStream(filename, { flags: "a" }); | ||
|
||
for (let j = 0; j < neuronsPerProcess; j++) { | ||
let x = centerX + math.random(-0.1, 0.1); | ||
let y = centerY + math.random(-0.1, 0.1); | ||
let z = centerZ + math.random(-0.1, 0.1); | ||
|
||
let neuron = new Neuron(x, y, z); | ||
writeStream.write(JSON.stringify(neuron) + ",\n"); | ||
} | ||
|
||
writeStream.end(); | ||
} | ||
); |
Oops, something went wrong.