Skip to main content
Module

x/netsaur/mod.ts>NeuralNetwork

Powerful machine learning, accelerated by WebGPU
Go to Latest
class NeuralNetwork
import { NeuralNetwork } from "https://deno.land/x/netsaur@0.1.5/mod.ts";

base class for neural network

Constructors

new
NeuralNetwork(config: NetworkConfig)

create a neural network

Properties

backend: Backend

Methods

addLayer(layer: Layer)

add layer to network

feedForward(input: any): Promise<any>

feed an input through the layers

get the biases of the network

getLayer(index: number)

get layers from the backend

get the weights of the network

initialize(inputSize: Size, batches?)

initialize the backend

predict(data: DataTypeArray | any)

use network to predict data

save(str: string)

save model to binary file

setupBackend(backendLoader: { backend: (config: NetworkConfig) => Promise<Backend>; })

setup backend and initialize network

Export the network in a JSON format

train(
datasets: DataSet[],
epochs?,
batches?,
learningRate?,
)

train network

Static Methods

fromJSON(
data: NetworkJSON,
helper?: (data: NetworkJSON, silent: boolean) => Promise<Backend>,
silent?,
)

Import the network in a JSON format

load(_str: string)

Load model from binary file