Skip to content

Instantly share code, notes, and snippets.

View sebjwallace's full-sized avatar

Sebastian Wallace sebjwallace

  • United Kingdom
View GitHub Profile
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:32
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'XOR',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:29
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'NAND',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:26
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'OR',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:33
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'AND',
initial: 'off',
states: {
off: {
on: {
1: 'x',
0: 'y'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:11
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'NOT',
initial: 'off',
states: {
off: {
on: {
HIGH: 'off',
LOW: 'on'
}
},
@sebjwallace
sebjwallace / machine.js
Created November 5, 2019 21:07
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'transistor',
initial: 'off',
states: {
off: {
on: {
HIGH: 'on',
LOW: 'off'
}
},
@sebjwallace
sebjwallace / machine.js
Last active November 5, 2019 21:03
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'switch',
initial: 'off',
states: {
off: {
on: {
FLIP: 'on'
}
},
on: {
@sebjwallace
sebjwallace / temporal-network.js
Last active May 28, 2018 18:28
Temporal Pooling inspired by cortical layers 4 & 2/3
class layer4 {
constructor(){
this.distal = [
// X,A,B,C,D,Y
[0,0,0,0,0,0], // X
[0,0,0,0,0,0], // A
[1,1,0,0,0,0], // B
[0,0,1,0,0,0], // C
@sebjwallace
sebjwallace / OR_AND_perceptron.js
Created May 13, 2016 17:44
Another simple 'perceptron' implementing a bias to work with both AND / OR
var inputs = [
[0,0],
[1,0],
[0,1],
[1,1]
]
var outputs = [
// AND
@sebjwallace
sebjwallace / AND_perceptron.js
Created May 13, 2016 16:44
One of the most simplest 'perception' training the 'AND' operator
var inputs = [
[0,0],
[1,0],
[0,1],
[1,1]
]
var outputs = [
0, 0, 0, 1