@dniskav/neuron 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -161,6 +161,10 @@ npm run build # outputs CJS + ESM + type declarations to dist/
161
161
  npm run dev # watch mode
162
162
  ```
163
163
 
164
+ ## For AI agents
165
+
166
+ If you are an AI agent or LLM working with this codebase, read [AGENTS.md](AGENTS.md) first. It contains the full class hierarchy, design constraints, and what this library does not do.
167
+
164
168
  ## License
165
169
 
166
170
  MIT
package/dist/index.js CHANGED
@@ -372,7 +372,7 @@ var NetworkLSTM = class {
372
372
  const grad = denseGrads[l];
373
373
  const prevDeltas = layerIn.map((out, j) => {
374
374
  const errProp = layer.neurons.reduce((s, n, k) => s + deltas[k] * n.weights[j], 0);
375
- return errProp * out * (1 - out);
375
+ return l === 0 ? errProp : errProp * out * (1 - out);
376
376
  });
377
377
  layer.neurons.forEach((n, k) => {
378
378
  n.weights.forEach((_, j) => {
package/dist/index.mjs CHANGED
@@ -340,7 +340,7 @@ var NetworkLSTM = class {
340
340
  const grad = denseGrads[l];
341
341
  const prevDeltas = layerIn.map((out, j) => {
342
342
  const errProp = layer.neurons.reduce((s, n, k) => s + deltas[k] * n.weights[j], 0);
343
- return errProp * out * (1 - out);
343
+ return l === 0 ? errProp : errProp * out * (1 - out);
344
344
  });
345
345
  layer.neurons.forEach((n, k) => {
346
346
  n.weights.forEach((_, j) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dniskav/neuron",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Minimal neural network from scratch — neuron, layer, network, backpropagation. No dependencies.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,12 +12,19 @@
12
12
  "types": "./dist/index.d.ts"
13
13
  }
14
14
  },
15
- "files": ["dist"],
15
+ "files": [
16
+ "dist"
17
+ ],
16
18
  "scripts": {
17
19
  "build": "tsup src/index.ts --format cjs,esm --dts --clean",
18
20
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch"
19
21
  },
20
- "keywords": ["neural-network", "machine-learning", "backpropagation", "typescript"],
22
+ "keywords": [
23
+ "neural-network",
24
+ "machine-learning",
25
+ "backpropagation",
26
+ "typescript"
27
+ ],
21
28
  "author": "dniskav",
22
29
  "license": "MIT",
23
30
  "devDependencies": {