Forum Discussion
"VBAF Learning Trail -- From Zero to AI Developer in PowerShell 5.1"
This is really cool way to teach it, building neural nets and RL agents in plain PowerShell strips away all the framework magic that usually hides what's actually happening. The "run it, watch it, break it" angle is exactly how it clicked for me too, reading about backprop never landed untill i stepped it line by line. One thing I'm curious about: how are you handling the matrix math under the hood, are you leaning on raw arrays or wrapping something like Math.NET? With 5.1 specifically I'd imagine performance gets intresting once the agents start training .Either way I'm bookmarking this and running through Camp 0 tonight.
- JupyterPSJun 25, 2026Copper Contributor
Pure raw arrays -- no Math.NET, no external libraries, nothing.
Every matrix operation is implemented as nested for-loops over [double[]] arrays. The weighted sum in a neuron is literally:
powershell
$sum = $this.Bias for ($i = 0; $i -lt $inputs.Count; $i++) { $sum += $inputs[$i] * $this.Weights[$i] }
No vectorisation. No BLAS. No GPU. Just arithmetic.
On performance:
Honest answer -- it is slow compared to Python. A DQN that trains in seconds in PyTorch takes 2-3 minutes in VBAF on the same hardware. The FastMode flag (smaller networks, shorter episodes) helps a lot for quick experiments.
But that is actually the point. When you see the training loop running step by step at human-readable speed, you can watch what the algorithm is doing. The slowness is a feature for learning -- you can insert Write-Host anywhere and see exactly what each neuron computed.
For production -- use Python. For understanding -- the slow version teaches you more.
The PayOff:
When you finish Camp 1 and open VBAF.Core.AllClasses.ps1 -- you can read the entire backpropagation implementation in one sitting. No autograd magic. No graph compilation. Just the chain rule written out explicitly. That is worth the performance tradeoff for learning purposes.
Enjoy Camp 0 tonight! 🇩🇰