-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
69 additions
and
21 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
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 @@ | ||
export { CPU } from "../src/cpu/mod.ts"; |
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 @@ | ||
export { GPU } from "../src/gpu/mod.ts"; |
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,4 @@ | ||
export { Native } from "../src/native/mod.ts"; | ||
export { Matrix } from "../src/native/matrix.ts"; | ||
export type { DataType } from "../src/native/matrix.ts"; | ||
export type { Dataset } from "../src/native/backend.ts"; |
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { ConvLayer, DenseLayer, NeuralNetwork } from "../mod.ts"; | ||
import { ConvCPULayer } from "../src/cpu/layers/conv.ts"; | ||
import { CPUMatrix } from "../src/cpu/matrix.ts"; | ||
import { CPUNetwork } from "../src/cpu/network.ts"; | ||
import { CPUBackend } from "../src/cpu/backend.ts"; | ||
import { CPU } from "../backends/cpu.ts"; | ||
import { PoolCPULayer } from "../src/cpu/layers/pool.ts"; | ||
import { PoolLayer } from "../src/mod.ts"; | ||
|
||
import { decode } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { DataTypeArray } from "../deps.ts"; | ||
import { PoolCPULayer } from "../src/cpu/layers/pool.ts"; | ||
import { PoolLayer } from "../src/mod.ts"; | ||
|
||
import { Canvas } from "https://deno.land/x/[email protected]/canvas/mod.ts"; | ||
|
||
import { Canvas } from "https://deno.land/x/[email protected]/canvas/mod.ts"; | ||
|
||
const canvas = new Canvas({ | ||
title: "Netsaur Convolutions", | ||
|
@@ -58,10 +60,10 @@ const net = await new NeuralNetwork({ | |
], | ||
cost: "crossentropy", | ||
input: 2, | ||
}).setupBackend("cpu"); | ||
}).setupBackend(CPU); | ||
|
||
const input = new CPUMatrix(buf, dim, dim); | ||
const network = net.network as CPUNetwork; | ||
const network = net.backend as CPUBackend; | ||
const conv = network.layers[0] as ConvCPULayer; | ||
const pool = network.layers[1] as PoolCPULayer; | ||
network.initialize({ x: dim, y: dim }, 1); | ||
|
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