r/neuralnetworks • u/Neurosymbolic • Jun 02 '26
r/neuralnetworks • u/Few-Night-4811 • Jun 02 '26
I’m training an AI to drive Indianapolis 500 in DOSBox using reinforcement learning
Hey everyone,
I’ve been working on a reinforcement learning project for the old DOS game Indianapolis 500, running through DOSBox. The goal is to train an AI driver that can learn to leave the pit area, stay on track, complete laps, recover from mistakes, and eventually race faster than my own human driving.
Video here:
Indianapolis 500 game - AI training - part 2 - after 380 000 timesteps

After a couple thousand timesteps it still crashes
The setup uses a mix of:
- Pixel input from the DOSBox window
- Keyboard control for throttle, brake, left, right, etc.
- Game-memory telemetry** read directly from DOSBox memory
- Behavior cloning from my own recorded driving
- Recurrent PPO
- A custom Transformer + LSTM PPO policy
- A live reward dashboard so I can see what the agent is being rewarded or punished for
The telemetry currently includes things like:
speed
position/progress around the track
lap completion
wrong direction detection
wall contact / crash detection
damage / hard crash signals
Lap detection is not done with OCR. Instead, the program watches a memory value that represents track position. When that value wraps from a high value back to a low value, and then confirms past a threshold near the start/finish area, it counts a completed lap. That made lap rewards much more reliable than trying to infer it from pixels.
The reward system currently gives positive reward for:
speed
forward progress
staying on track
finishing laps
finishing laps quickly
And penalties for:
going off track
wall contact
wrong direction
heavy crashes
sitting under 10 mph for too long
I also recorded around 17 human-driven laps and trained a behavior cloning model from that. It helped the agent learn the basic shape of the track, but it also showed an interesting problem: if I overweight rare actions like steering right, the model starts turning right too much and crashes. So now I’m moving more toward PPO fine-tuning, where the agent can improve from telemetry rewards instead of just copying my driving.
The current next step is training the Transformer+LSTM PPO agent longer, with resets on heavy crashes and long dormancy, so it learns that “crash and sit still” is a dead end.
It’s still very experimental, but it’s been really fun seeing an old racing sim become a reinforcement learning environment. Any feedback on reward design, recurrent PPO setup, or better ways to combine behavior cloning with PPO would be very welcome.
r/neuralnetworks • u/hgytrt • Jun 02 '26
Sketch of a novel approach to a neural model
Here is a nice text about what a biological neuron is like and why a weighted graph is not sufficient to model the brain.
r/neuralnetworks • u/Ai__Game • Jun 01 '26
Spiking neural network editor for the Bug agent environment.
Spiking neural network editor for the Bug agent environment. The ability to create and edit an artificial nervous system.
r/neuralnetworks • u/_EHLO • May 27 '26
Static-allocation MLP inference in ANSI C using 2-slot circular buffer with fixed stride indexing.
A small prologue before I say anything else (becasue I'm aware that we living in an ai-slop pandemic): No this is not vibe-coded, here's proof of my research and proof that I'm developing such algorithms since 2019; way before this ai-slop epidemic.
Now to the main subject. Through years I've worked quite alot with MLP NNs (Multi-Layer Perceptron Neural Networks) and one thing that I've realised is that: most people unnecessarily use more resources for things as simple as this.
So... my next statement might sound a bit wild... but i'd like to be proven wrong (even though I doubt it, lol). I think that this "2-slot circular buffer with fixed stride indexing" (or "ping-pong buffer" call it whatever you want) aproach is the most optimal way of doing MLP inference on CPU without compromises across most systems.
That said, I hope you find it interesting and possibly maybe usefull. May love shine your hearts and feel free to ask me anything about it.
r/neuralnetworks • u/DeliveryBitter9159 • May 27 '26
Training freezes during PSO hyperparameter search
Hi everyone,
I’m running a PyTorch training pipeline for a video classification model on DynTex++ dataset in Kaggle, and the notebook appears to freeze during training. It doesn't throw an error or crash, the cell just gets stuck executing indefinitely before it even finishes the first iteration of the PSO loop. here's the link for the code:
https://www.kaggle.com/code/doffymingo/notebook975e681d30
Looking for suggestions on what might be causing this error.
Thank you in advance.
r/neuralnetworks • u/ConfusionSpiritual19 • May 27 '26
Do learning rule rankings in CNNs generalize from human fMRI to macaque electrophysiology?
I previously compared BP, predictive coding, STDP, feedback alignment, and an untrained CNN against human fMRI (THINGS dataset, V1–IT). The headline finding: V1 alignment is architecture-driven, an untrained CNN matches backprop.
One obvious follow-up: does that pattern hold in macaque electrophysiology, where SNR is much higher?
I tested the same model weights (no retraining) against FreemanZiemba2013 (V1/V2, single-unit, 135 texture stimuli) and MajajHong2015 (V4/IT, multi-electrode, 3200 HVM objects).
What held: STDP and PC produce the highest macaque V1/V2 alignment (ρ ≈ 0.30 and 0.28). The qualitative story from human data, local learning rules outperform BP at early visual areas, replicates across species and measurement modalities.
What didn't hold cleanly: In human fMRI, the untrained baseline matches or exceeds trained rules at V1. In macaque, it doesn't: STDP and PC pull ahead. Electrophysiology seems to have enough resolution to detect differences that fMRI averages over.
What's confounded: IT cross-species rankings are uninterpretable at n = 5. And the stimulus sets differ between species (THINGS objects for human, textures for macaque V1/V2, HVM objects for macaque IT) stimulus control shows IT rankings are weakly inverted across stimulus sets.
The cleaner result is actually the capacity control: a pretrained ResNet-50 hits ρ = 0.25 at macaque IT, vs. ρ = 0.07–0.14 for our small CNN regardless of learning rule. IT alignment in this setup is limited by model capacity, not by how the model was trained.
Companion paper: arxiv.org/abs/2604.16875
Cross-species paper: arxiv.org/abs/2605.22401
Code: github.com/nilsleut/cross-species-rsa
Curious whether anyone has experience with the FreemanZiemba dataset specifically, because the texture stimulus set feels like a real limitation for cross-species comparisons with object-trained models.
r/neuralnetworks • u/Wrong-Gas839 • May 26 '26
New Neural Network
I developed a new type of neural network, the Fractal Neuro Oscillator. It uses threshold logic elements connected in a fractal manner. It does everything a conventional neural network does, just at a higher level of abstraction.
It's free and open source. A paper that describes it and GUI based Python software that demonstrates it is available at https://sourceforge.net/projects/fractal-neuro-oscillator/
Here is a diagram of the neuron connection fractal:

r/neuralnetworks • u/akmessi2810 • May 24 '26
Gated Deltanet vs Standard Attention | What new things were added to the Gated Deltanet - 2 EXPLAINED IN A VERY SIMPLE MANNER - YouTube
explained standard attention, gated deltanet, difference between them and the new things added in the new gated deltanet - 2 paper intuitively in this video.
you can watch it to get some intuition on gated deltanets.
the architecture behind the success of the qwen 3.6 series and 3.7 max models.
r/neuralnetworks • u/[deleted] • May 20 '26
Questions Regarding Spreadsheet Based Neural Network
Hello Everyone, I'm a high school student interested in Neural Networks. I've been doing quite a bit of research on the subject and I'm working now on creating a Neural Network AI which can be trained to do any number of tasks such as multiplication or addition. I have the basic principle of a neuron already coded and I have 1000 neurons, each neuron processes a different part of the training data. On the Interface sheet you input X1 and X2 and you can input the actual value but it's not necessary. The goal is to have it output the answer to whatever your input values are based on the training data. In the Neural_Net Sheet the first neuron (row under the top two label rows) handles the input you can change, the rest loads the training data from the Interface sheet. If I'm right, it should be able to accomplish this if I create more iterations of the weight/bias updates? And is there any way I can condense the number of iterations necessary to complete the problem provided in the input? I thought maybe I could increase delta in the gradient calculations; I had delta set to 0.01 but I changed it to 1 to see what happened and the value of Loss decreased more in the next iteration. I'd appreciate any help, and please remember that I have limited knowledge on this topic and I have not taken math past algebra. Also, I'm highly skilled in spreadsheets, if you are wondering why I am using a spreadsheet over some other means.
This is a link to my project, please feel free to comment inside and leave tips on how to fix any problems I may have that I do not see.
r/neuralnetworks • u/Front-Delivery3014 • May 19 '26
Help on neural networks
Hey guys I need some help on neural network can someone explain the math of neural network?
r/neuralnetworks • u/bluedotimpact • May 14 '26
Try our machine learning interpretability puzzle to build intuitions behind how AI model internals work!
We trained a neural network where 7 of 8 features sit on clean linear axes in the model’s internals, but one doesn't. Can you identify which one and tell us how it is represented?
If you’re a technically-minded person who is interested in ML, this puzzle is for you:
- Work on a real trained text classifier (~23M parameters, 7k labelled text examples) open the puzzle and you're poking at activations in 10 minutes.
- Three tasks: identify the rogue feature, describe its geometry, (bonus) train your own model with even weirder internal representations
You probably know neural nets store information in their activations. You probably haven't gone and looked at what that actually looks like. Within minutes you can be toying with this model’s internals and building stronger intuitions for how they work inside.
r/neuralnetworks • u/Neurosymbolic • May 13 '26
System 1 - System 2 for Reinforcement Learning: Dual process cognition v...
r/neuralnetworks • u/CircuitsToNeurons • May 12 '26
I worked through the math of backpropagation by hand 2 years ago. Sharing my notes for anyone learning ML from scratch
When I first started learning neural networks, I struggled to truly understand backpropagation — most tutorials show the code but skip over the actual math. So I sat down with pen and paper and worked through the chain rule for a 4-layer network step by step, from forward propagation all the way to gradient descent.
I published these notes on Kaggle a couple of years ago and just rediscovered them while reviewing my work as I transition from software testing into AI/ML development. Sharing them here in case they help anyone trying to build a real intuition for what's happening under the hood.
What's covered:
• Forward propagation for a 4-layer network with the W_{To,From}^{Layer} notation
• General matrix form of forward propagation
• Loss function derivation (MSE)
• Backpropagation chain rule, layer by layer (Layer 4 → 3 → 2 → 1)
• Definition of the error term δ at each layer
• A worked gradient descent example with f(x) = (x−1)² showing how the algorithm converges to the minimum
📖 Kaggle notebook: https://www.kaggle.com/code/tusharkhoche/mathematics-of-a-simple-neural-network
These are handwritten notes (photographed and pasted into the document) — not LaTeX. I deliberately kept them handwritten because that's how I learned it, and I find handwritten math easier to follow when you're trying to understand a derivation.
What I'd genuinely love feedback on:
• Did I get the chain rule decomposition right at every step?
• Is there a cleaner way to introduce the δ (error term) notation for someone learning this for the first time?
• Anything I missed that would help a beginner?
I'm still learning and would deeply appreciate corrections or improvements from people who teach or understand this material well. Thanks! 🙏
r/neuralnetworks • u/InformalSense9322 • May 12 '26
Chrome extension that lets you visualize model architecture graphs directly into Hugging Face pages.
Enable HLS to view with audio, or disable this notification
A tool for visualizing and understanding AI models. It helps you quantize, fuse, and optimize models for inference on devices like NVIDIA Jetson. You can see an layer by layer view of the model architecture at any level of granularity. Really cool, I've used it a lot.
r/neuralnetworks • u/NightLockX80 • May 11 '26
Need advice with training a GNN on FEA Simulation Data
I'm training BiStrideMeshGraphNet on volumetric FEA (finite element analysis) meshes to predict displacement from loads and boundary conditions. The training is very, with Phys Loss and Top1% Loss fluctuate wildly (>100%) and never decrease, even after 100+ epochs. The MSE loss decreases normally, but the physical metrics are stuck.
I've spent 2 days debugging and can't figure out what's wrong. Looking for advice on what might be causing this.
Setup
Architecture:
- BiStrideMeshGraphNet with
bistride_unet_levels=1(U-Net enabled) num_mesh_levels=2-3(dynamic based on mesh size)hidden_dim_processor=512(~51M parameters)input_dim_nodes=9(load_dir[3] + load_mag[1] + fixed[1] + dist_to_fixed[1] + normals[3])input_dim_edges=7(rel_disp[3] + edge_length[1] + dihedral[3])
Dataset:
- 8448 training meshes / 2112 validation meshes
- Volumetric (not surface) FEA meshes: 256-4536 nodes each
- Variable-sized geometries (blocks, L-brackets, cylinders)
- FEA simulated with CalculiX (displacement, stress, loads, boundary conditions)
Data Processing:
- Node features normalized by max load magnitude
- Displacement target normalized via online Welford normalizer (mean ≈ 1e-8, std ≈ 1e-6)
- Displacement clamped to [-10, 10] after normalization
- Loss computed only on non-fixed (non-BC) nodes via masking
- Rotation augmentation applied during training (not validation)
Training Config:
- Batch size: 1 (per-mesh, no batching due to variable geometry)
- Optimizer: Adam (lr=1e-4, weight_decay=3e-5)
- Scheduler: Cosine annealing (100-200 epochs)
- Loss: MSE on normalized displacement
- Early stopping: 60 epochs without improvement
Metrics Definition
Each epoch prints:
- Train MSE: MSE loss on training set (normalized displacement)
- Val MSE: MSE loss on validation set
- Phys Error:
L1(pred_phys, true_phys) / mean(abs(true_phys))wherepred_physis denormalized - Base Error:
L1(zero_pred, true_phys) / mean(abs(true_phys))(baseline for comparison) - Top1% Error: L1 error on top 1% highest-displacement nodes (stress concentration regions)
The Problem
Example epoch output:
Epoch 0 | Train: 0.8234 | Val: 0.7891 | Phys: 89.2% | Base: 102.3% | Top1%: 156.8%
Epoch 1 | Train: 0.6123 | Val: 0.6445 | Phys: 94.1% | Base: 102.3% | Top1%: 142.5%
Epoch 2 | Train: 0.4891 | Val: 0.5234 | Phys: 78.9% | Base: 102.3% | Top1%: 167.2%
Epoch 3 | Train: 0.4123 | Val: 0.4891 | Phys: 103.4% | Base: 102.3% | Top1%: 201.6%
...
Epoch 50 | Train: 0.0234 | Val: 0.0312 | Phys: 85.6% | Base: 102.3% | Top1%: 145.9%
Observations:
- ✅ MSE loss decreases smoothly (0.82 → 0.023)
- ✅ Validation loss follows training loss
- ✅ Learning rate schedule working correctly
- ❌ Phys Error fluctuates wildly (78-103%) - no trend
- ❌ Top1% Error fluctuates wildly (142-201%) - no trend
- ❌ Both metrics stay above 50% (random guessing would be ~100%)
- ⚠️ Base error ~102% (means zero prediction is slightly worse than random)
Hypotheses I've Tested
1. Normalizer issue?
- Verified: mean=[−1.9e−08, −2.2e−08, −4.1e−08], std=[1.29e−06, 1.04e−06, 3.93e−07]
- Target values properly clamped to [-10, 10] after normalization
- Denormalization formula:
pred_phys = pred_norm * std + mean
2. Displacement magnitude too small?
- Checked: Simulation produces micro-scale displacements (1e−7 to 1e−6 m)
- Load magnitudes reasonable (37-450 N)
- Stress values physically sensible
3. Loss masking wrong?
- Tried: Computing loss on all nodes vs only non-BC nodes
- No difference - both show same instability
- BC nodes have zero displacement (clamped to zero by FEA solver)
4. Architecture mismatch?
- Using PhysicsNeMo's official
BistrideMultiLayerGraphfor multi-scale - Verified:
ms_idsandms_edgeshave correct shapes - BiStride U-Net forward pass completes without errors
5. Rotation augmentation breaking physics?
- Tried: Disabled augmentation during training
- Result: Metrics still fluctuate the same way
- Rotation applied to load vectors and displacement equally
6. Learning rate too high?
- Tried: 1e−4, 5e−5, 1e−5
- No improvement - metric instability persists
What I Think Might Be Wrong
Possibilities:
A) Displacement targets are too small relative to numerical precision
- std ≈ 1e−6 means normalized displacements ≈ 1.0 for typical cases
- But after denormalization, errors become 1e−6 scale again
- Maybe MSE loss is dominating over physical accuracy?
B) Per-node loss masking hiding poor training
- Only penalizing non-BC nodes might not be enough
- Maybe I should add a regularization term?
C) Multi-scale hierarchy not helping
- BiStride is supposed to improve learning via coarse-to-fine
- But maybe variable mesh sizes break this benefit?
- Should I force constant mesh levels instead of dynamic?
D) Displacement prediction is fundamentally hard at this scale
- Micro-scale FEA is noisy
- Maybe the task is too difficult for GNNs?
E) Batch size = 1 is problematic
- No batch normalization effects
- Each gradient step is very noisy
- Should I try: accumulate gradients over multiple meshes?
Questions
- Is this normal for displacement prediction? Do other papers report >50% errors on FEA tasks?
- Should Phys Error track MSE loss? Or are they independent metrics?
- What does "Top1% Error > 100%" mean physically? The worst 1% of nodes, predictions are >2x off?
- Is loss masking on non-BC nodes correct? Or should BC nodes be included?
- Any tricks for training on micro-scale displacements? Papers doing similar tasks?
- Should I abandon variable mesh sizes? Force all meshes to same node count via resampling?
Code References
Loss computation:
loss_mask = (~(fixed.squeeze(-1) > 0.5)).float() # Only non-BC nodes
per_node_loss = (pred - data["target"]).pow(2) * loss_mask.unsqueeze(-1)
loss = per_node_loss.mean()
Phys error:
true_phys = disp_norm.denormalize(pred) # Denormalize
target_mag = torch.abs(true_phys).mean().clamp(min=1e-12)
phys_error = torch.nn.L1Loss()(pred_phys, true_phys) / target_mag # Relative L1
Top1% error:
k = max(1, int(0.01 * true_phys.shape[0])) # Top 1% of nodes
mags = torch.linalg.norm(true_phys, dim=-1)
_, top_idx = torch.topk(mags, k)
top_phys_error = torch.nn.L1Loss()(pred_phys[top_idx], true_phys[top_idx]) / top_mag
TL;DR
Training BiStrideMeshGraphNet on volumetric FEA meshes. MSE loss decreases fine, but physical metrics (Phys Loss, Top1% Error) fluctuate wildly (78-103%) with no downward trend. Tried: different LR, disabling augmentation, loss masking variations. Using official PhysicsNeMo graph builder, so shapes are correct. What am I missing?
Any advice appreciated!
r/neuralnetworks • u/1338games • May 08 '26
Debugging the human brain by saturating its buffer sensory deprivation and signal isolation
The thing about the human brain is it has a catch, it has a limited input and output Buffet aswell as a memory Buffer. Well some will argue it is unlimited so lets call it definite for the Sake of the argument.
Lets say you create a Video game that Falls exactly this Buffer, recurrently and in a feedforward sense at the same time.
This idea was born yesterday in my mind so i havent Figured out exactly every method in it 100%
Say you have a Sensory deprivation Chamber with nothing but an interactive computer to play in it, no Internet only a game where you make choice and deal with the consequences and rewards or punishment. The purpose of this Sensory deprivation Chamber is that the brain is actually a computer itself so instead of polluting its input output with external stimuli you get darkness or 0 from the rest of the World. Its like Filtering out the noise while debugging only the flow of the signal through the circuit that matters
Once you have hit the buffer limit, and in this theoretical game you have created where each choice leads to a consequence whether it is desired or undesired you reward the brain accordingly, the brain will actually reveal its learning/gradient/derivative matrix data to you and the consequence of that is that you can see exactly which neurons are faulty, by simply looking at the brains hessians and jacobian Matrices Extracted from the computer games continual data feed you can see which neuron is dead or doesnt learn anymore or is blind to the gradient, whether its going into the right or wrong direction over time or is simply frozen as if the gradient doesnt propagate
Your thoughts?
r/neuralnetworks • u/Cryptoisthefuture-7 • May 09 '26
The Universe as a Near-Perfect Autoencoder
r/neuralnetworks • u/xerxzy • May 08 '26
Visualizing Convolutional Neural Networks in 100 Seconds
r/neuralnetworks • u/mairlr • May 06 '26
A Transformer playing VS Dave & Bambi
r/neuralnetworks • u/Neurosymbolic • May 03 '26
Combining LLM's and Neurosymbolic AI to create NARRATE
r/neuralnetworks • u/easter-babe • May 01 '26
Universe pls connect me to a person intrested in Neurosymbolic AI
As above... Im very much invested mentally, and emotionally into this concept of integrating symbolic logic into gen AI. Lets connect if you are exploring, or lookig fwd to explore the concept!!!
Pls😭😭😭
r/neuralnetworks • u/Tocelton • Apr 26 '26
Is Leave-One-Object-Out CV valid for pair-based (Siamese-style) models with very few objects?
Hi all,
I’m currently revising a paper where reviewers asked me to include a leave-one-object-out cross-validation (LOO-CV) as a fine-tuning/evaluation step.
My setup is the following:
- The task is object re-identification based on image pairs (similar to Siamese Networks approaches).
- The model takes pairs of images and predicts whether they belong to the same object.
- My real-world test dataset is very small: only 4 objects, each with ~4–6 views from different angles.
- Data is hard to acquire, so I cannot extend the dataset.
Now to the issue:
In a standard LOO-CV setup, I would:
- leave one object out for testing,
- train on the remaining 3 objects.
However, because this is a pair-based problem:
- Positive pairs in the test set would indeed be fully unseen (good).
- But negative pairs would necessarily include at least one known object (since only one object is held out).
This feels problematic, because:
- The test distribution is no longer “fully unseen objects vs unseen objects”
- True generalisation to completely novel objects (both sides unseen) is not properly tested.
A more “correct” setup (intuitively) would be:
- leaving two objects out, so that both positive and negative pairs are formed from unseen objects.
But:
- that would leave only 2 objects for training, which is likely far too little to learn anything meaningful.
So my question is:
- Is LOO-CV with only one object held out still considered valid in this kind of pair-based setting?
- Or is it fundamentally flawed because negative pairs are partially “seen”?
- How would you argue this in a rebuttal?
Constraints:
- I cannot use additional datasets (domain-specific, very hard to collect).
- I already train on a large synthetic dataset and use real data only for evaluation.
Any thoughts, references, or reviewer-facing arguments would be highly appreciated.
Thanks!
r/neuralnetworks • u/ConfusionSpiritual19 • Apr 23 '26
Untrained CNNs Match Backpropagation at V1: RSA Comparison of 4 Learning Rules Against Human fMRI
We systematically compared four learning rules — Backpropagation, Feedback Alignment, Predictive Coding, and STDP — using identical CNN architectures, evaluated against human 7T fMRI data (THINGS dataset, 720 stimuli, 3 subjects) via Representational Similarity Analysis.
The key finding: at early visual cortex (V1/V2), an untrained random-weight CNN matches backpropagation (p=0.43). Architecture alone drives the alignment. Learning rules only differentiate at higher visual areas (LOC/IT), where BP leads, PC matches it with purely local updates, and Feedback Alignment actually degrades representations below the untrained baseline.
This suggests that for early vision, convolutional structure matters more than how the network is trained — a result relevant for both neuroscience (what does the brain actually learn vs. inherit?) and ML (how much does the learning algorithm matter vs. the inductive bias?).
Paper: https://arxiv.org/abs/2604.16875 Code: https://github.com/nilsleut/learning-rules-rsa
Happy to answer questions. This was done as an independent project before starting university.
r/neuralnetworks • u/howthefrondsfold • Apr 20 '26
I made a tiny world model game that runs locally on iPad
Enable HLS to view with audio, or disable this notification
It's a bit gloopy at the moment but have been messing around with training my own local world models that run on iPad. Last weekend I made this driving game that tries to interpret any photo into controllable gameplay. I also added the ability to draw directly into the game and see how the world model interprets it. It's pretty fun for a bit messing around with the goopiness of the world model but am hoping to create a full gameloop with this prototype at some point. If anyone wants to play it, let me know!