open-index/open-npm huggingface dataset:
npm package: @ml.js/ann
Description: Neural networks in the browser !!
Author: Nippun Sharma
Latest version: 0.1.0-beta.1

`@ml.js/ann` is a library powered my `mlpack` that can run

neural networks right in the browser. It uses emscripten to

compile the c++ codebase of mlpack to WebAssembly.

#### Install (via npm).

```bash
npm install "@ml.js/ann"
```

#### Basic Usage.

```typescript
import { mljsInit } from "@ml.js/core";
import { Matrix } from "@ml.js/linalg";
import { FFN, Linear, MSELoss, ConstInit, ReLU, Adam } from "@ml.js/ann";

mljsInit().then(() => {
  const trainX = new Matrix<number>({ n_rows: 1, n_cols: 5 }, "double"); // currently ann only supports double matrices.
  const trainY = new Matrix<number>({ n_rows: 1, n_cols: 5 }, "double");
  trainX.fromArray([0, 1, 2, 3, 4]);
  trainY.fromArray([0, 1, 2, 3, 4]);

  const model = new FFN<MSELoss, ConstInit>(new MSELoss, new ConstInit(2.5)); // create FFN instance.
  model.Add<Linear>(new Linear(2)); // add a linear layer, currently regularization is not supported.
  model.Add<ReLU>(new ReLU());
  model.Add<Linear>(new Linear(1));
  model.Add<ReLU>(new ReLU());

  model.Train<Adam>(trainX, trainY, new Adam()); // start training using default Adam optimizer.
  const preds = model.Predict(trainX); // predict on data.
});
```
npm package: @ml.js/linalg
Description: A package for linear algebra in the browser !!
Author: Nippun Sharma
Latest version: 0.1.0-beta.3

@ml.js/linalg is a linear algebra library for the browser based on [armadillo](https://gitlab.com/conradsnicta/armadillo-code).

@ml.js/linalg uses Web Assembly to run armadillo code (in C++) in the browser.

### Steps to install.
This library can be installed directly via npm:
```bash
npm install "@ml.js/linalg"
```

### Basic usage.
```typescript
import { mljsInit } from "@ml.js/core";
import { Matrix } from "@ml.js/linalg";

await mljsInit(); // initialize mljs-core.

async getMatrix() {
  const A: Matrix<number> = new Matrix<number>({ n_rows: 2, n_cols: 2 }, "float");
  return A;
}

const A = await getMatrix();
A.funcFill((i, j) => i + j); // fill matrix A.
const B = A.t(); // transpose of A.

console.log(A.toString());
console.log(B.toString());
```

### Steps to build.
1. Clone github repo.
```bash
git clone --recurse-submodules https://github.com/NippunSharma/mljs_linalg
```
2. Move to project dir.
```bash
cd mljs_linalg
mkdir -p build
```
3. Build clapack object files first.
```bash
make clapack
```
4. Build `mljs_linalg.wasm` binary along with `mljs_linalg.js`.
```bash
make mljs_linalg
```
5. Now, generate the `dist` dir.
```bash
npm run build
```

Alternatively, you can directly execute `npm run build` and it will
use the pre-existing binary file in `resources/`. However, if anything
is changed in `src/embind`, it is recommended to rebuild the binary.