Skip to content

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
load1n9 committed Feb 2, 2024
1 parent 4e73131 commit d24b78c
Show file tree
Hide file tree
Showing 23 changed files with 88 additions and 85 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Denosaurs
Copyright (c) 2024 Denosaurs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>
<hr/>

## Powerful Machine Learning library for Deno.
## Powerful Machine Learning library for Deno

## Features

Expand Down Expand Up @@ -253,7 +253,7 @@ console.log(`1 xor 1 = ${out4[0]} (should be close to 0)`);
### Documentation

The full documentation for Netsaur can be found
[here](https://deno.land/x/netsaur@0.2.15/mod.ts).
[here](https://deno.land/x/netsaur@0.3.0/mod.ts).

### License

Expand Down
2 changes: 1 addition & 1 deletion crates/core-gpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "netsaur-gpu"
version = "0.2.15"
version = "0.3.0"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "netsaur"
version = "0.2.15"
version = "0.3.0"

[lib]
crate-type = ["cdylib"]
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ pub fn wasm_backend_predict(id: usize, buffer: Float32Array, options: String) ->
let options: PredictOptions = serde_json::from_str(&options).unwrap();
let inputs = ArrayD::from_shape_vec(options.input_shape, buffer.to_vec()).unwrap();

let mut res = ArrayD::zeros(options.output_shape);
let res = ArrayD::zeros(options.output_shape);

RESOURCES.with(|cell| {
let mut backend = cell.backend.borrow_mut();
let res = backend[id].predict(inputs, options.layers);
let _res = backend[id].predict(inputs, options.layers);
});
Float32Array::from(res.as_slice().unwrap())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tokenizers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "netsaur-tokenizers"
version = "0.2.15"
version = "0.3.0"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion data/deps.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { CsvParseStream } from "https://deno.land/std@0.208.0/csv/csv_parse_stream.ts";
export { CsvParseStream } from "https://deno.land/std@0.214.0/csv/csv_parse_stream.ts";
37 changes: 18 additions & 19 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{
"tasks": {
"example:xor": "deno run -A --unstable ./examples/xor_auto.ts",
"example:xor-option": "deno run -A --unstable ./examples/xor_option.ts",
"example:xor-cpu": "deno run -A --unstable ./examples/xor_cpu.ts",
"example:xor-gpu": "deno run -A --unstable ./examples/xor_gpu.ts",
"example:xor-wasm": "deno run -A --unstable ./examples/xor_wasm.ts",
"example:linear": "deno run -A --unstable ./examples/linear.ts",
"example:multiple-linear": "deno run -A --unstable ./examples/multiple-linear/student.ts",
"example:binary": "deno run -A --unstable ./examples/classification/binary_iris.ts",
"example:multiclass": "deno run -A --unstable ./examples/classification/iris.ts",
"example:text": "deno run -A --unstable ./examples/classification/spam.ts",
"example:filters": "deno run -A --unstable examples/filters/conv.ts ",
"example:autoencoder": "deno run -A --unstable examples/autoencoders/test.ts ",
"example:train": "deno run -A --unstable examples/model/train.ts ",
"example:run": "deno run -A --unstable examples/model/run.ts ",
"example:mnist-download": "deno run -A --unstable examples/mnist/download.ts ",
"example:mnist-train": "deno run -A --unstable examples/mnist/train.ts ",
"example:mnist-predict": "deno run -A --unstable examples/mnist/predict.ts ",
"example:tokenizers-basic": "deno run -A --unstable examples/tokenizers/basic.ts",
"build": "deno task build:cpu && deno task build:wasm && deno task build:gpu && deno task build:tokenizers",
"example:xor": "deno run -A --unstable-ffi ./examples/xor_auto.ts",
"example:xor-option": "deno run -A --unstable-ffi ./examples/xor_option.ts",
"example:xor-cpu": "deno run -A --unstable-ffi ./examples/xor_cpu.ts",
"example:xor-gpu": "deno run -A --unstable-ffi ./examples/xor_gpu.ts",
"example:xor-wasm": "deno run -A ./examples/xor_wasm.ts",
"example:linear": "deno run -A --unstable-ffi ./examples/linear.ts",
"example:multiple-linear": "deno run -A --unstable-ffi ./examples/multiple-linear/student.ts",
"example:binary": "deno run -A --unstable-ffi ./examples/classification/binary_iris.ts",
"example:multiclass": "deno run -A --unstable-ffi ./examples/classification/iris.ts",
"example:text": "deno run -A --unstable-ffi ./examples/classification/spam.ts",
"example:filters": "deno run -A --unstable-ffi examples/filters/conv.ts ",
"example:train": "deno run -A --unstable-ffi examples/model/train.ts ",
"example:run": "deno run -A --unstable-ffi examples/model/run.ts ",
"example:mnist-download": "deno run -A --unstable-ffi examples/mnist/download.ts ",
"example:mnist-train": "deno run -A --unstable-ffi examples/mnist/train.ts ",
"example:mnist-predict": "deno run -A --unstable-ffi examples/mnist/predict.ts ",
"example:tokenizers-basic": "deno run -A examples/tokenizers/basic.ts",
"build": "deno task build:cpu && deno task build:wasm && deno task build:tokenizers",
"build:cpu": "cargo build --release -p netsaur",
"build:gpu": "cargo build --release -p netsaur-gpu",
"build:wasm": "deno run -A https://deno.land/x/[email protected]/main.ts -p netsaur --out src/backends/wasm/lib",
Expand Down
4 changes: 4 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/multiple-linear/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Multiple Linear Regression
This example showcases linear regression on a dataset with multiple variables.

This example showcases linear regression on a dataset with multiple variables.
2 changes: 1 addition & 1 deletion examples/multiple-linear/student.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
tensor2D,
} from "../../mod.ts";

import { parse } from "https://deno.land/std@0.204.0/csv/parse.ts";
import { parse } from "https://deno.land/std@0.214.0/csv/parse.ts";

// Import helpers for splitting dataset
import { useSplit } from "https://deno.land/x/[email protected]/mod.ts";
Expand Down
6 changes: 3 additions & 3 deletions examples/visualize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
}
],
"source": [
"import { tensor1D } from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"import { Visualizer } from \"https://deno.land/x/netsaur@0.2.15/visualizer/mod.ts\";\n",
"import { tensor1D } from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
"import { Visualizer } from \"https://deno.land/x/netsaur@0.3.0/visualizer/mod.ts\";\n",
"\n",
"import {\n",
" Cost,\n",
Expand All @@ -74,7 +74,7 @@
" setupBackend,\n",
" SigmoidLayer,\n",
" tensor2D,\n",
"} from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"} from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
" \n",
"await setupBackend(AUTO);\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions examples/xor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
],
"source": [
"import { setupBackend, CPU } from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"import { setupBackend, CPU } from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
"await setupBackend(CPU);"
]
},
Expand Down Expand Up @@ -68,7 +68,7 @@
}
],
"source": [
"import { setupBackend, WASM } from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"import { setupBackend, WASM } from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
"await setupBackend(WASM);"
]
},
Expand All @@ -92,7 +92,7 @@
"metadata": {},
"outputs": [],
"source": [
"import { setupBackend, GPU } from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"import { setupBackend, GPU } from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
"await setupBackend(GPU);"
]
},
Expand All @@ -109,7 +109,7 @@
"metadata": {},
"outputs": [],
"source": [
"import { Sequential, DenseLayer, SigmoidLayer, Cost, tensor2D, tensor1D } from \"https://deno.land/x/netsaur@0.2.15/mod.ts\";\n",
"import { Sequential, DenseLayer, SigmoidLayer, Cost, tensor2D, tensor1D } from \"https://deno.land/x/netsaur@0.3.0/mod.ts\";\n",
"const net = new Sequential({\n",
" /**\n",
" * The number of minibatches is set to 4 and the output size is set to 2.\n",
Expand Down
2 changes: 1 addition & 1 deletion src/backends/cpu/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const options: FetchOptions = {
name: "netsaur",
url: new URL(import.meta.url).protocol !== "file:"
? new URL(
"https://github.com/denosaurs/netsaur/releases/download/0.2.15/",
"https://github.com/denosaurs/netsaur/releases/download/0.3.0/",
import.meta.url,
)
: "./target/release/",
Expand Down
2 changes: 1 addition & 1 deletion src/backends/gpu/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const options: FetchOptions = {
name: "netsaur_gpu",
url: new URL(import.meta.url).protocol !== "file:"
? new URL(
"https://github.com/denosaurs/netsaur/releases/download/0.2.15/",
"https://github.com/denosaurs/netsaur/releases/download/0.3.0/",
import.meta.url,
)
: "./target/release/",
Expand Down
24 changes: 12 additions & 12 deletions src/backends/wasm/lib/netsaur.generated.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @generated file from wasmbuild -- do not edit
// deno-lint-ignore-file
// deno-fmt-ignore-file
// source-hash: a728f73002f1cb653f10fe9495ef33f79d70a523
// source-hash: c9542d0a368cde5bdc27d321129d74bf6d2c53ee
let wasm;
let cachedInt32Memory0;

Expand Down Expand Up @@ -203,23 +203,13 @@ const imports = {
__wbindgen_object_drop_ref: function (arg0) {
takeObject(arg0);
},
__wbg_log_8d8708b5d26d7ac1: function (arg0, arg1) {
__wbg_log_05fb09f7b2225305: function (arg0, arg1) {
console.log(getStringFromWasm0(arg0, arg1));
},
__wbindgen_number_new: function (arg0) {
const ret = arg0;
return addHeapObject(ret);
},
__wbg_getRandomValues_37fa2ca9e4e07fab: function () {
return handleError(function (arg0, arg1) {
getObject(arg0).getRandomValues(getObject(arg1));
}, arguments);
},
__wbg_randomFillSync_dc1e9a60c158336d: function () {
return handleError(function (arg0, arg1) {
getObject(arg0).randomFillSync(takeObject(arg1));
}, arguments);
},
__wbg_crypto_c48a774b022d20ac: function (arg0) {
const ret = getObject(arg0).crypto;
return addHeapObject(ret);
Expand Down Expand Up @@ -263,6 +253,16 @@ const imports = {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
},
__wbg_randomFillSync_dc1e9a60c158336d: function () {
return handleError(function (arg0, arg1) {
getObject(arg0).randomFillSync(takeObject(arg1));
}, arguments);
},
__wbg_getRandomValues_37fa2ca9e4e07fab: function () {
return handleError(function (arg0, arg1) {
getObject(arg0).getRandomValues(getObject(arg1));
}, arguments);
},
__wbg_newnoargs_2b8b6bd7753c76ba: function (arg0, arg1) {
const ret = new Function(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
Expand Down
Binary file modified src/backends/wasm/lib/netsaur_bg.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/backends/wasm/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class WASMInstance {
await instantiate({
url: new URL(import.meta.url).protocol !== "file:"
? new URL(
"https://github.com/denosaurs/netsaur/releases/download/0.2.15/netsaur_bg.wasm",
"https://github.com/denosaurs/netsaur/releases/download/0.3.0/netsaur_bg.wasm",
import.meta.url,
)
: undefined,
Expand Down
3 changes: 1 addition & 2 deletions src/core/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { WASM } from "../backends/wasm/mod.ts";
import { Sequential } from "./mod.ts";
import { Backend, BackendType, NetworkConfig } from "./types.ts";

// deno-lint-ignore no-window-prefix
window.onerror = () => {
onerror = () => {
if (typeof Deno == "undefined") {
throw new Error(
"Warning: Deno is not defined. Did you mean to import from ./web.ts instead of ./mod.ts?",
Expand Down
Loading

0 comments on commit d24b78c

Please sign in to comment.