This file contains hidden or 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
export function compareFilters(filterDeltas, inputs, deltas) { | |
const startingInputY = this.thread.y - this.constants.paddingY | |
const startingInputX = this.thread.x - this.constants.paddingX | |
let deltaSlideY = 0 | |
let sum = filterDeltas[this.thread.z][this.thread.y][this.thread.x] | |
for (let y = 0; y < this.constants.slideHeight; y++) { | |
deltaSlideY++ | |
let deltaSlideX = 0 |
This file contains hidden or 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
filters x=0,y=0,z=0 inputs | |
width=6,height=6,depth=2 width=4,height=4,depth=2 | |
[*][ ][ ][ ][ ][ ] * _ [*][ ][*][ ] * | |
[ ][ ][ ][ ][ ][ ] _ [ ][ ][ ][ ] _ | |
[ ][ ][ ][ ][ ][ ] * _ [*][ ][*][ ] * | |
[ ][ ][ ][ ][ ][ ] _ [ ][ ][ ][ ] _ | |
[ ][ ][ ][ ][ ][ ] * _ * _ * _ * | |
[ ][ ][ ][ ][ ][ ] | |
[ ][ ][ ][ ] | |
[ ][ ][ ][ ] |
This file contains hidden or 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
{ | |
"Vegetable Bar and Gril": ["Monday"], | |
"Southern North America Grill": ["Sunday"], | |
"Behind The House Burgers": ["Tuesday"], | |
"Robert Evans": ["Tuesdays"], | |
"Brewwwi": ["Monday"], | |
"Currows": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], | |
"Seeby & Buckets": ["Thursday"], | |
"Captain E’s": ["Thursday"], | |
"The Delusion Last Railway Car": ["Thursday"], |
This file contains hidden or 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
const convnet = require('./build/convnet'); | |
const v = new convnet.Vol(2,2,1); | |
v.set(0, 0, 0, 1); | |
v.set(0, 1, 0, 2); | |
v.set(1, 0, 0, 3); | |
v.set(1, 1, 0, 4); | |
// const output = convnet.FullyConnLayer.prototype.forward.call({ |
This file contains hidden or 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
class StaticBridge { | |
public static build<T>(Type: T, c: Api): any { | |
return Object.getOwnPropertyNames(Type) | |
.filter((prop) => typeof Type[prop] === "function") | |
.reduce((methods, method) => ({ | |
// tslint:disable-next-line:no-any | |
...methods as any, | |
[method]: async (v: any): Promise<any> => { | |
return Type[method](v, c); | |
}, |
This file contains hidden or 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
import { | |
add, | |
multiply, | |
random, | |
sigmoid | |
} from './'; | |
export default function feedForward(settings, input) { | |
const { width, height } = settings; | |
const weights = random({ width, height }); |
This file contains hidden or 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
class Item { | |
public static async get<Options extends { id: string }>(o: Options, api: Api): Promise<Item> { | |
return new Promise<Item>((accept, reject) => { | |
console.log(api); | |
accept(new Item()); | |
}); | |
} | |
public static async search<Options extends { query: string }>(o: Options, api: Api): Promise<Item[]> { | |
return new Promise<Item[]>((accept, reject) => { |
This file contains hidden or 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
//This will come in handy | |
import { AxiosStatic } from "axios"; | |
import { Container } from "inversify"; | |
import Request from "../request"; | |
class AxiosCoreMock implements AxiosCore {} | |
const container = new Container(); | |
container.bind(Request).toSelf(); | |
container.bind<AxiosCore>("axios").toConstantValue(new AxiosCoreMock()); |
This file contains hidden or 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
function round(a) { | |
return Math.floor(a + 0.5); | |
}; | |
function vectorDotProduct(V1x, V1y, V1z, V2x, V2y, V2z) { | |
return (V1x * V2x) + (V1y * V2y) + (V1z * V2z); | |
}; | |
function unitVectorX(Vx, Vy, Vz) { | |
var magnitude = Math.sqrt((Vx * Vx) + (Vy * Vy) + (Vz * Vz)); |
This file contains hidden or 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
const outputTextureName = `TEXTURE${ paramNames.length + i + 1 }`; | |
const subKernelOutputTexture = this.subKernelOutputTextures[i]; | |
gl.activeTexture(gl[outputTextureName]); | |
gl.bindTexture(gl.TEXTURE_2D, subKernelOutputTexture); | |
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); | |
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); | |
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); | |
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); | |
if (this.floatOutput) { | |
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.FLOAT, null); |