Supported features: depth-clip-control, texture-compression-bc, texture-compression-etc2, texture-compression-astc, address-mode-clamp-to-border, texture-adapter-specific-format-features, clear-texture
error: Uncaught (in promise) WebGPUValidationError:
Shader '' parsing error: expected ',', found ';'
ββ wgsl:3:17
β
3 β inputSize: u32;
β ^ expected ','
: expected ',', found ';'
const err = new Error(error.value ?? "unknown");
^
at InnerGPUDevice.proto.pushError (https://crux.land/api/get/4ZZB5m.ts:7:19)
at GPUDevice.createShaderModule (deno:ext/webgpu/01_webgpu.js:1237:14)
at WebGPUBackend.register (https://raw.githubusercontent.com/denosaurs/neo/main/backend/webgpu/backend.ts:52:32)
at feedForward (https://deno.land/x/[email protected]/src/gpu/kernels/feedforward.ts:19:34)
at BaseGPULayer.feedForward (https://deno.land/x/[email protected]/src/gpu/layers/base.ts:118:11)
at GPUNetwork.feedForward (https://deno.land/x/[email protected]/src/gpu/network.ts:51:27)
at GPUNetwork.train (https://deno.land/x/[email protected]/src/gpu/network.ts:111:20)
at async NeuralNetwork.train (https://deno.land/x/[email protected]/src/mod.ts:60:5)
at async file:///home/erfanium/Documents/deno_mnist/sample.ts:28:1
import { NeuralNetwork } from "https://deno.land/x/[email protected]/mod.ts";
import { DataSet } from "https://deno.land/x/[email protected]/src/types.ts";
import { loadTest, loadTrain } from "./loader.ts";
const [x, y] = await loadTrain("data");
const trainData: DataSet[] = [];
for (let i = 0; i < 10; i++) {
trainData.push({
inputs: x[i],
outputs: [y[i] / 10],
});
}
const net = await new NeuralNetwork({
hidden: [
{ size: 10, activation: "sigmoid" },
],
cost: "crossentropy",
output: { size: 1, activation: "sigmoid" },
input: {
type: "f32",
},
silent: false,
}).setupBackend(true, false);
await net.train(
trainData,
200,
1,
0.1,
);