Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netsaur/packages/core/src/backends/cpu/backend.ts>CPUBackend

Powerful Powerful Machine Learning library with GPU, CPU and WASM backends
Latest
class CPUBackend
implements Backend
import { CPUBackend } from "https://deno.land/x/netsaur@0.4.2/packages/core/src/backends/cpu/backend.ts";

CPU Backend.

Constructors

new
CPUBackend(
library: Library,
outputShape: Shape<Rank>,
id: bigint,
)

Properties

library: Library
outputShape: Shape<Rank>

Methods

predict(input: Tensor<Rank>, config: { postProcess: PostProcessor; outputShape?: Shape<Rank>; }): Promise<Tensor<Rank>>
predict(
input: Tensor<Rank>,
config: { postProcess: PostProcessor; outputShape?: Shape<Rank>; },
layers: number[],
): Promise<Tensor<Rank>>
save(): Uint8Array
saveFile(path: string): void
train(
datasets: DataSet[],
epochs: number,
batches: number,
rate: number,
): void

Static Methods

load(buffer: Uint8Array, library: Library): CPUBackend
loadFile(path: string, library: Library): CPUBackend