Skip to content

Instantly share code, notes, and snippets.

View adrianseeley's full-sized avatar

Adrian Seeley adrianseeley

View GitHub Profile
@adrianseeley
adrianseeley / LDAG_E00_BOILERPLATE.html
Last active August 29, 2015 13:56
Let's Do Artificial Genetics - Episode 00 - Boilerplate
<html>
<body>
<canvas id="canvas"></canvas>
<script type="text/javascript">
// ask the DOM for our canvas element
var canvas = document.getElementById('canvas');
// set the size of our canvas element to the size of the browser window
// since we will be using this as our whole workspace we want to capitalize
@adrianseeley
adrianseeley / GATO.MEDIUM.cs
Last active August 29, 2015 13:56
GATO.MEDIUM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace GATO.MEDIUM
{
class Program
@adrianseeley
adrianseeley / GATO.PLINKO.js
Created February 27, 2014 18:43
GATO.PLINKO
function Plinko () {
var Ref = {
Train: function (Training_Set, Train_Till_Errors, Train_Till_Iterations, Max_Medium_Population, Nerf_Rate) {
// Define processes
var Processes = [
function Process_Identity (Self) {
// Distribute all inputs to all outputs
for (var a = 0; a < Self.Outputs.length; a++) for (var b = 0; b < Self.Inputs.length; b++) Ref.Medium[Self.Outputs[a].Layer][Self.Outputs[a].Node].Inputs.push(Self.Inputs[b]);
},
function Process_Summation (Self) {
@adrianseeley
adrianseeley / GATO.GENNA.js
Last active August 29, 2015 13:56
GATO.GENNA.js
//<html><script>
function genna (input_nodes) {
// create identity genna
var identity = [];
// iterate through number of input nodes required
for (var a = 0; a < input_nodes; a++)
@adrianseeley
adrianseeley / wgf.js
Last active August 29, 2015 13:56
GATO - WEIGHTED GENETIC FOLDER
//<html><script>
function weighted_genetic_folder (number_of_inputs, number_of_nearest_neighbours) {
var identity_weights = [];
for (var i = 0; i < number_of_inputs; i++)
identity_weights.push(1);
var ret = {
number_of_nearest_neighbours: number_of_nearest_neighbours,
weights: identity_weights,
genetic_folds: [],
neighbourhood: [],
@adrianseeley
adrianseeley / GATO.WGF.cs
Created March 4, 2014 16:26
GATO.WEIGHTED GENETIC FOLDER (C#) - IRIS -> 0 ERRORS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace GATO.WGF
{
class Program
@adrianseeley
adrianseeley / GATO.AUTOFEATURE.cs
Created March 5, 2014 22:08
GATO.AUTOFEATURE - automatically optimizes feature selection using weights, capable of handling 1 Million+ features, also draws pretty smears
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Drawing;
using System.Threading;
namespace GATO.AUTOFEATURE
@adrianseeley
adrianseeley / GATO.KNNSATURIZATION.cs
Created March 11, 2014 09:53
GATO.KNNSATURIZATION - very inefficiently explores KNN saturation rates on the MNIST OCR set, draws pretty KNN waveform graphs too.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Drawing;
using System.Diagnostics;
namespace GATO.KNNSATURATION
@adrianseeley
adrianseeley / helpful.glsl
Created March 12, 2014 18:03
Useful GLSL functions - Random and Encode Float
float random(vec2 seed) {
return fract(cos(mod(123456780., 1024. * dot(seed / time, vec2(23.1406926327792690, 2.6651441426902251)))));
}
float shift_right(float v, float amt) {
v = floor(v) + 0.5; return floor(v / exp2(amt));
}
float shift_left(float v, float amt) {
return floor(v * exp2(amt) + 0.5);
}
float mask_last(float v, float bits) {
@adrianseeley
adrianseeley / col.js.html
Created March 12, 2014 21:10
Genetic Color Sort
<div id="log"></div><br>
<canvas id="canvas" width="256", height="256"></canvas>
<script type="text/javascript">
//<canvas id="canvas" width="4096", height="4096"></canvas>
var log = document.getElementById("log");
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var imgdata = ctx.createImageData(canvas.width, canvas.height);
function set_pixel (x, y, r, g, b) {