r/FunMachineLearning • • Dec 24 '25

I vibe-coded a "Dreaming" AI Trading Bot (Local Llama 3). It made $15 today and Gemini roasted me for it.

Post image
86 Upvotes

The Project:
It runs a background "Dream" loop where an onboard 20B model (running locally) updates a Knowledge Graph based on correlations it finds in real-time. It connects nodes, hallucinates narratives (e.g., "Trucking drives Inflation"), and executes paper trades based on a "Committee" of agents.

The Results:
I ran it on the Christmas Eve half-day session.

  • Starting Capital: $10,000

  • Net Profit: $15.00 (Pure alpha, baby).

The Audit:
I fed the logs to Gemini for a thesis analysis. It was... unkind.

It also described my UI as "little more than watching an ant colony rendered as a pseudo-quant dashboard."

Honestly? Fair. But looking at the graph connect nodes is satisfying.


r/FunMachineLearning • • Dec 29 '25

[Update] I made a bare‑metal LLM chat REPL (UEFI, no OS) — you can literally talk to it after USB boot

19 Upvotes

Update on my “LLM with no OS” experiment: it now has a real chat REPL.

Plug USB → UEFI boots → you get:
You: ...
AI: ...

It loads the ~60MB stories15M checkpoint and generates text directly inside the UEFI environment (x86_64). No Linux/Windows at any point.

Repo: https://github.com/Djiby-diop/llm-baremetal

Note: decoding is greedy for now, so the tiny model can repeat—next step is temperature/top‑p + repetition penalty.


r/FunMachineLearning • • Dec 04 '25

Is anyone working on a general-purpose memory layer for AI? Not RAG. Not fine-tuning. Actual persistent memory?

20 Upvotes

I’ve been deep in the weeds trying to solve long-term memory for LLMs, and after months of experiments, I’ve hit the same wall over and over: everything we currently call “AI memory” is just retrieval… wearing different outfits.

  • Chat history until the window explodes.

  • Vector search until embeddings drift or flatten context.

  • Graph RAG until the graph turns into spaghetti.

  • Fine-tuning until catastrophic forgetting erases half your brain.

None of these give an AI anything resembling persistent state. They just reconstruct context from scratch every turn.

The more I worked on this, the more obvious the missing piece became: we don’t have a memory system that lives outside the model, evolves over time, and feeds any model the right state when needed.

I’m talking about something like a memory layer that sits between the user and any LLM:

  • Tracks entities, timelines, preferences, decisions, contradictions

  • Stores updates incrementally instead of rewriting whole histories

  • Maintains continuity (“Adam last spoke to you on Tuesday about X”)

  • Handles temporal meaning, not just semantic similarity

  • Is model-agnostic, works with GPT, Claude, local models, anything

  • Lets users control what’s retained, forgotten, or corrected

Basically: LLMs stay stateless tools, and the memory becomes its own product surface.

Not a vector DB. Not another RAG wrapper. A persistent state machine that learns, updates, resolves conflicts, decays, and exposes clean, queryable memory to any model.

I’m exploring this direction and trying to pressure-test the idea, but before I go too deep, I want to sanity check two things:

  1. Does anyone here see this as viable, or is it doomed by constraints I’m not accounting for?

  2. What would you actually want such a system to remember? People? Projects? Goals? Preferences? Events?

  3. Which domains need this the most — personal assistants, agents, customer workflows, coding copilots?

Would love to hear from people who’ve attempted something similar or hit walls with current RAG-based memory. I’m trying to figure out whether this should exist as infrastructure, a standalone app, or if users simply don’t care enough yet.


r/FunMachineLearning • • Dec 14 '25 Bravo

[P] I made an LLM run on bare-metal (no OS) - Boots from USB in 5 seconds

165 Upvotes

Hey r/MachineLearning!

I built a transformer that runs on raw UEFI firmware—no OS needed.

Code: https://github.com/Djiby-diop/llm-baremetal

What it does:

• Insert USB → Boot in 5 seconds

• 60MB Stories15M model loads

• Generates 150 tokens

• No operating system at any point

Tech: 6 layers, 288 dims, 15M params, SSE2 optimized, BPE tokenizer

Why? Zero OS overhead, perfect for embedded/IoT, pure learning.

Built on u/karpathy's llama2.c.


r/FunMachineLearning • • Sep 13 '26

Have you automated your tech news/research with AI? What’s your setup?

1 Upvotes

Hey everyone,

I’m trying to build an automated tech monitoring system using AI.

The idea is to automatically collect interesting stuff from different sources — Reddit, X, Hacker News, newsletters, blogs, GitHub, etc. — then use AI to filter out the noise and duplicates and give me a daily digest of what’s actually worth reading.

Has anyone here already built something like this?

I’m especially curious about:

  • What sources do you use?

  • How do you collect the data? RSS, APIs, scraping?

  • How do you decide what’s actually relevant?

  • What tools / AI models / automation do you use?

  • How do you avoid getting overwhelmed with low-quality content?

I’d love to hear about your setup, even if it’s something completely homemade.

Thanks!


r/FunMachineLearning • • 16d ago

提升神经网络性能的一些本质思考: 从极难数独的求解研究经历说起 [D]

4 Upvotes

图灵奖得主 理查德·萨顿(Richard Sutton)提出了**《苦涩的教训》**:人类精心设计的各种领域先验知识(Priors / 归纳偏置),长远来看,统统不如“纯粹的搜索(Search)+ 学习(Learning)”再配合摩尔定律带来的暴力算力扩展(Scaling)。

以下我将用神经网络解决极难数独的经历,来更深入的讨论这个扩展。

说到这里顺便提一嘴hrm架构吧,在hrm论文出现之前,我正在研究适合消费者显存的超长文本架构,并且也有了如何扩展网络推理性能的一些初步设想,并规划了后续进行一些该方向的研究,只是没想到,2025年7月份我在知乎刷到了关于hrm架构(https://arxiv.org/abs/2506.21734)的介绍,我发现我的思路正好和它的有些相似。hrm架构提出的快慢思考架构,本身对解决数独不是必需的,其效果也并不好,快慢双流只是一种讲讲故事的方式,其实我并不明白为什么非得讲个故事才行呢?后面的trm(https://arxiv.org/abs/2510.04871)也证明了不用快慢双流架构,单纯只是循环,效果也可以更好。当然我们并不能抹去hrm的贡献,正是因为hrm火了,才有后续的trm,甚至gram等研究,而且,后续就传出claude训练模型使用了循环网络,再后续又爆出gpt模型使用了循环网络。所以我其实有个猜想链条: hrm,trm等证明了循环网络在小模型上提升了推理能力,信奉扩展定律的Anthropic和openai,开始在大模型方向进行扩展,当规模定律开始涌现,出现了gpt这种直接平推大量数学猜想的怪物模型。当然,这个链条是我猜想的,并不一定符合实际。

正好我开始空闲下来,想研究一下arc-agi, 直接求解arc-agi问题是不现实的,从简到繁,积累经验,才是更好的解决问题的方式(这个描述暗合了我们今天讨论的神经网络的思想本质)。既然都是推理问题,先解决极难数独吧,借此探讨一下神经网络性能扩展的本质。

用神经网络来解决极难数独问题。首先考虑三要素:算力+架构+数据,首先,算力上,hrm和trm等,都用的多gpu训练,而我只有一个16g显存的gpu,第二,算力有限,架构需要针对性优化,第三,数据,我并未采用1000条小样本,而是用的全量的sapientinc/sudoku-extreme的训练数据。

我开始考虑各种方式提升神经网络解决数独的能力,初始想法是提升神经网络强化学习的内生推理能力,我把能用的方法全都用了,比如中间层监督,针对数独特化loss,强化学习思路(前面层要为后面层的思考,提供最大解决问题回报),也对架构进行了各种修改,我尝试了各种方式,模型越来越聪明了,学习越来越快了,原来需要一轮才能增加几个点,变成训练1轮,直接10个点甚至20个点的准确率提升,我以为找到了解决方案,但是,后面随着训练进行,验证集准确率,到接近60%时。就卡住了,无论怎么训,怎么改架构,都无济于事。此时我发出了第一次绝望的总结。。

总结原文是(神经网络内化前向推理方法暂时放弃了: https://www.zhihu.com/pin/1974873461747897363):神经网络内化前向推理方法暂时放弃了, 正如我之前说的,直接采取最后一层的输出结果进行训练,解决极难数独数据集的正确率不会超过10%,但是加了一些引导,改变模型架构后,模型前期学习的速度是不同的,有些学的很快,有些很慢,但是最终都会收敛到60%这个值,即后续无论如何改损失函数,甚至把流扩散思想,中间软性损失等各种方法都试了,也加大模型深度与参数,某些层计算格子早停(模拟数独先填一些格子),困难集反复训练(类似强化学习里的经验回放)等各种手段都试了,最终训练10轮后,验证集正确性基本都是收敛到60%附近。说明前向一次性得到答案这种本身,是不是数学理论上就是这个结果,反正我也没那个能力证明。至于采取rnn方法(类似扩散模型那种多步迭代),天然去模拟人类迭代解题的思路,因为已经有别人研究过了(如hrm,trm),我没有兴趣用这种方法去做。总之,这个内化推理有用(不做内化时准确率低于10%),但是有一定上限,当然可能是受限于我个人能力原因,也许别人能把他做的更好。这个方向暂时放弃了,前后对比研究不知不觉一个月就快过去了。当成对自己失败探索的一个记录吧。

在某天我刷知乎时,发现一篇论文的介绍(1000 Layer Networks for Self-Supervised RL

: https://arxiv.org/abs/2503.14858),大概是讲强化学习的,说的是神经网络深度到达某些层后,会自然涌现出不同的新技能,我从这个里面得到了极大的启发,然后我认真思考这个背后的本质,对于残差网络,本质是h,大概是讲强化学习的,说的是神经网络深度到达某些层后,会自然涌现出不同的新技能,我从这个里面得到了极大的启发,然后我认真思考这个背后的本质,对于残差网络,本质是h) = h + dh, 即每层对主状态进行修改,而这个修改方式,和我们对神经网络的参数训练时的梯度下降非常相似,参数空间的主算法就是w = w – lr * grad, 本质上也是一种牛顿迭代法思想,也可以用“不积跬步,无以至千里”来直观解释。所以我怀疑当前我的神经网络深度不够,导致其正确率无法提升,因此我直接将其扩展到120层,数独正确率终于突破60%,最高到了76%左右,而且后面我开始做消融实验,发现把那些莫名奇妙的优化方式去掉,一样能到76%。也做了12层网络,循环10次,模型等效深度是120层的网络,发现其训练速度和最后达到的准确率,和原生的120层网络基本一致。但是,当前网络也仅仅到76%,再继续提升深度大概率还能增加正确率,但是训练资源消耗已经让我放弃了,我必须思考在我有限算力下,解决数独推理难题的方法。

当遇到瓶颈时,我采取了另外一种曲线救国的方式,我开始思考,我在解决数独时,究竟把数独看成是什么了,而结论是,从一开始,我就把数独当成一个图形推理问题在解决,既然我做的是生图,我就去研究生图模型了,毕竟初生牛犊不怕虎,我是各种概念乱想,乱实验,比如压缩概念空间啊(实际上后面发现已经有类似的方案如var,far等),vq-vqe,光一个向量离散化思路,都研究了n种不同变体,比如fvq, fsq,lsq等等,然后各种损失gan loss,感知损失,l1损失,软性高斯损失等等,还有改架构,cnn,transformer,混合体,mlp-mixer,改变图形数据构建方式,比如将其看成以列为基元,训练时从左列往右列自回归,patch为基元进行自回归,也研究了流匹配生图,最后总结下来,还是流匹配效果最好,只是此前的研究都是在小批量图形上,我开始研究完整的图形生成时,发现在我的机器上,耗时太久,一旦开始训练,我的其它研究方向就只能暂停,这是不可接受的。再次遇到算力之墙,一声叹息。

生图模型也遇到瓶颈了,闲来无事,刷知乎又看到了图灵奖得主本吉奥解决数独的gram论文(https://arxiv.org/pdf/2605.19376),其解决数独问题已经到达了接近100%,但是没有论文源码,他们论文提到了参数扩展不是很方便,所以我只是看了这个方案,也并未跟进。不过这篇论文给我很大的信心,即神经网络是可以解决极难数独的。,其解决数独问题已经到达了接近100%,但是没有论文源码,他们论文提到了参数扩展不是很方便,所以我只是看了这个方案,也并未跟进。不过这篇论文给我很大的信心,即神经网络是可以解决极难数独的。)

此时我已经具备了神经网络的大部分直觉,受gram论文鼓舞,而基于此前我的研究,我认为解决数独问题,一定要在深度迭代上进行研究,某个晚上,我考虑极端思想实验,比如假设模型是1万层,这个1万层该怎么训练呢,直接给最后一层加上loss,不现实的,哪怕有残差流,梯度回传和深度加深后的表征也是个问题,加中间监督吧,比如每10层一个监督,最后一个1000个loss叠加起来,再简化一点,既然数独只关心等效深度,那我直接用一个10层网络,循环1000次,就可以了,到这时,我灵光一闪,流匹配模型,就满足我的所有的需求啊。

因此我立马起床,用最快的速度写好训练代码,开始训练,并且每隔5000步用验证集测试正确率,其指标一路快速攀升,和我之前采取了各种方法的模型一样聪明,最终一样达到76%左右。但是,我验证时,用的推理迭代次数是固定的,权重固定后,我尝试让模型等效深度提升,比如nfe从20加大到100等,使用多条轨迹采样等,其迭代能力会下降,因此把迭代结果重新改到更前面的时间去进行处理等,当我把这些方法都用上后,数独问题,一下子突破99.29%甚至更高,问题基本解决,并且我发了知乎文章进行性能总结。原文如下:

模型参数16.54M,为一个12层的网络架构,遵循测试时计算性能提升。统计结果如下:

max_retries=1 thinking_steps = [10] 73.23%

max_retries=1 thinking_steps = [20] 75.98%

max_retries=1 thinking_steps = [50] 78.32%

max_retries=1 thinking_steps = [100] 79.87%

max_retries=1 thinking_steps = [200] 81.39%

max_retries=5 thinking_steps = [10] 79.76%

max_retries=10 thinking_steps = [10] 82.56%

max_retries=20 thinking_steps = [10] 85.21%

max_retries=50 thinking_steps = [10] 88.81%

max_retries=50 thinking_steps = [20] 92.19%

max_retries=100 thinking_steps = [10] 91.54%

max_retries=100 thinking_steps = [20] 94.28%

max_retries=100 thinking_steps = [50] 96.26%

max_retries=1000 thinking_steps = [20] 98.22%

max_retries=1000 thinking_steps = [50] 99.29%

其中max_retries,即llm中的pass@k,计算量越大,最后测试数独正确率能到99.29%, 基本算已经解决数独问题了,之前一直很想给模型足够的训练时间,观察模型的顿悟现象,刚好这次放假回家,就让模型一直训练了几天,回来后也发现模型并未出现顿悟现象,最终性能只能通过测试时计算提升了。继续研究正确率极限已经没有意义了,接下来研究如何提升推理效率。

很明显,此时推理效率太低了,后面通过优化推理方式,将推理效率提升了50倍。最后我也兴奋的发了文章进行记录,原文为:

之前我已经解决了极难数独推理问题,但是其推理效率低下,max_retries=100 thinking_steps = [50] 96.26%,由于网络是12层,相当于正确率达到96%,平均要执行60000次网络层,而现在基于同一权重下,通过优化推理采样方式,96%的正确率时,max_retries=5 thinking_steps = [20] ,平均执行1200次网络层,推理效率提升了50倍,继续研究,进一步提升推理效率。

后面我对架构进一步简化,不用任何花里胡哨的先验规则(比如加上宫,行,列等先验),直接一个rope 2维位置编码+transformer架构+流匹配,效果一模一样。

到此为止,我算比较完美的解决了数独问题了,然后着手准备论文,结果发现今年已经有两篇类似论文出现,分别为:Flow Reasoning Models: Turning Flows Into Efficient Recurrent Reasoners https://arxiv.org/pdf/2606.29150和 Thinking with Looped Flows https://arxiv.org/abs/2609.11801 ,这两篇论文都是采用流匹配思路,解决极难数独推理问题,所以我就不太想整理论文了,作为文章,当作一个记录发出来吧。

不过上述FRM等论文,推理效率仍然低下,当接近100%时,其前向推理深度需要几千层,而我的方法,大概只要240层甚至更少。正如我所说,我们采取的数据集不一样,我是用的sapientinc/sudoku-extreme进行训练,天然不用担心记忆导致的泛化难题,而FRM采用的是sapientinc/sudoku-extreme-1k,所以没啥对比性。

我将流匹配用在着色,N皇后等问题上,也是很完美的解决了问题,所以流匹配本身就是一个比较优质的离散推理网络。

自此,我们可以对神经网络解决问题进行一个大概的总结了,我们可以选择对参数进行扩展,这导致了大模型的诞生,对序列长度进行扩展,这导致了思维链的诞生,同时也可以对神经网络深度进行扩展(采取循环神经网络或者流匹配等方式),当这些扩展方式综合起来后,配合强化学习,大概率就会诞生gpt解决千禧年难题的这个怪物模型。


r/FunMachineLearning • • Apr 11 '26

Hi everyone, I’m a software engineer with around 1 year of experience, and I’m looking to start learning AI/ML from scratch. Currently, I don’t have much background or understanding in this area. There’s a huge amount of content available (courses, YouTube videos, blogs), but I’m feeling overwhelm

4 Upvotes

r/FunMachineLearning • • Dec 12 '25

AI With Mood Swings? Trying to Build Tone-Matching Voice Responses

4 Upvotes

Side project concept: tone-aware voice-to-voice conversational AI
I’ve been thinking about experimenting with a small ML project. The idea is an app that:

  1. Listens to a user’s speech.

  2. Performs tone/emotion classification (anger, humor, calm, etc.).

  3. Converts the speech to text.

  4. Feeds the transcript into an LLM.

  5. Uses a library of custom voice embeddings (pre-labeled by tone) to synthesize a response in a matching voice.

Basically: tone in → text → LLM → tone-matched custom voice out.

Has anyone here worked on something similar or used emotion-aware TTS systems? Wondering how complex this pipeline would get in practice.


r/FunMachineLearning • • Nov 06 '25

Open-source MCP Security scanner

4 Upvotes

We are building an open-source security scanner to catch below issues:

  • Prompt Injection

  • Indirect Prompt Injection

  • Cross-Origin Escalation

  • Tool Poisoning

  • Tool Name Ambiguity

  • Command Injection

  • Excessive Permission

  • PIl Detection

Most scanners we have tried are noisy, endless alerts and false positives. We think developers deserve better. We are looking for early design partners who want to help shape something that actually works.

If this sounds interesting, drop a comment or DM, would like to chat and get your thoughts.


r/FunMachineLearning • • Jun 29 '26

I built a free interactive website to learn machine learning by experimenting instead of just reading

Post image
7 Upvotes

When I started learning machine learning, I kept asking "what actually changes when I move this slider?"

Most tutorials show the final result but not how the model gets there.

That led me to build Confluence.

It's an open-source platform where you can experiment with different algorithms, datasets, hyperparameters, and visualizations while seeing everything update in real time.

I'm still actively improving it, so I'd really love feedback from people who are currently learning ML.

What would make something like this more helpful for beginners?

Website:
https://confluence.website

GitHub:
https://github.com/mahirmlk/Confluence


r/FunMachineLearning • • Oct 08 '25

Meta Superintelligence’s surprising first paper

Thumbnail
paddedinputs.substack.com
2 Upvotes

TL;DR

  • MSI’s first paper, REFRAG, is about a new way to do RAG.

  • This slightly modified LLM converts most retrieved document chunks into compact, LLM-aligned chunk embeddings that the LLM can consume directly.

  • A lightweight policy (trained with RL) decides which chunk embeddings should be expanded back into full tokens under a budget; the LLM runs normally on this mixed input.

  • The net effect is far less KV cache and attention cost, much faster first-byte latency and higher throughput, while preserving perplexity and task accuracy in benchmarks.

Link to the paper: https://arxiv.org/abs/2509.01092

Our analysis: https://paddedinputs.substack.com/p/meta-superintelligences-surprising


r/FunMachineLearning • • Jun 24 '25

I Trained an AI to Nuke The Moon With Reinforcement Learning

8 Upvotes

I used my own neural network cpp library to train an Unreal Engine nuke to go attack the moon. Check it out: https://youtu.be/H4k8EA6hZQM


r/FunMachineLearning • • Aug 24 '26

Visualization is a Human Superpower

3 Upvotes

This is just from my experience building a Machine Learning system using ChatGPT Plus. I found that if you use visual terms to suggest a path forward, then rely on the Data Science Lab on your iPad to prove your hypothesis using scripting methods on verified data sets BEFORE it’s ever committed to your “magicmachined” code, you remove the risk that your strategy is in error before messing with the heart of your code.

It’s the creative visualization part is what allows you to get the chatbot working on solving the the data problem experimentally fast so that you can change direction and conduct a series of experiments without wasting a lot of compute if the current path isn’t working out. AI is great at generating data science and finding standouts, but not so good at innovating around problems from different angles using visualization.


r/FunMachineLearning • • Jan 16 '26

A parrot stopped visiting my window, so I built a Raspberry Pi bird detection system instead of moving on

Thumbnail gallery
4 Upvotes

r/FunMachineLearning • • Feb 27 '26

voulez-vous en savoir plus sur les algorithmes ou les aides en fonctionnements que peux nous apporter IA

3 Upvotes

👋Bonjour, bonsoir à tou(te)s.

Soyez les bienvenue à toutes et à tous sur notre blog dédié à l’intelligence artificielle, explorée sous toutes ses facettes. Ici, le débat est ouvert et les idées circulent librement ! Nous analysons les questions les plus marquantes et les plus actuelles autour de l’IA, afin de vous offrir un contenu riche, clair et stimulant.

Préparez-vous à une lecture captivante que vous ne voudrez pas manquer.

Si cet article vous a plu, laissez-nous un commentaire pour partager votre avis et abonnez-vous afin de ne manquer aucune de nos prochaines publications passionnantes.😊


r/FunMachineLearning • • Feb 24 '26

New Springer Nature paper: Explainable AI framework for Anti-Money Laundering (SHAP-based)

2 Upvotes

Hi r/research,

My paper was recently published in Discover Artificial Intelligence (Springer Nature).

Citation:
Mazumder, P.T. (2026). Explainable and fair anti-money laundering models using a reproducible SHAP framework for financial institutions.
https://doi.org/10.1007/s44163-026-00944-7

Summary:
This paper proposes a reproducible SHAP-based explainable AI framework to improve transparency, fairness, and interpretability in anti-money laundering and financial risk detection models.

I’d appreciate any feedback or discussion. Thanks!


r/FunMachineLearning • • Feb 24 '25

Building a learning community

3 Upvotes

Hi everyone! My friend and I started a free Discord group called Teach to Learn, where members host and attend monthly presentations on various topics to grow skills and network.

You can sign up to present or just join in to learn something new. Last month we covered Algorithms and Data Structures; next month’s topic is Stakeholder Communication in Tech.

In this competitive job market, hoping connecting like minded individuals excited to learn new skills will help give an extra edge.

DM me if you’re interested or want the link. Hope to see you there!


r/FunMachineLearning • • Jul 26 '25

This AI Learns Faster Than Anything We’ve Seen! - Two Minute Papers

Thumbnail
youtube.com
4 Upvotes

r/FunMachineLearning • • Jan 29 '26

Meta’s New AI Just Leveled Up Virtual Humans - Two Minute Papers

Thumbnail
youtube.com
2 Upvotes

r/FunMachineLearning • • 10d ago

Funkiest Zoom meeting EVER (Surprise video) - Two Minute Papers

Thumbnail
youtube.com
2 Upvotes

r/FunMachineLearning • • Oct 15 '26

We gave a decision model anytime reasoning

6 Upvotes

We've been working on Span-02. Instead of choosing low/medium/high reasoning, you give it a time budget in milliseconds.

We asked it “land or water?” for 4,050 coordinates. Then plotted the answers.

Reasoning off: 71.9% accuracy.

300ms to think: 84.5%.

That's what you're seeing in the video. The weights are open.


r/FunMachineLearning • • Jul 12 '26

From-Scratch Language Model (custom CUDA and C++ kernels)

5 Upvotes

Hi guys! I'm Nai, and I would really like to share this learning journey of mine with you all.

A few months ago, I got the interest to understand machine learning, I didn't know where exactly to start, but I just did the simplest thing, which is asking. I just searched on youtube "how to make a neural network", that was the farthest thing I knew about machine learning back then. I found the youtube tutorial series "Neural Networks from Scratch in Python" by sentdex.
I was genuinely blown away over how simple it turned to be. I just wondered if I could go a bit deeper, so, I started a C++ project, I tried my best to replicate every piece of math a neural network would need to run in a structured style, with classes, functions and everything. despite some concepts being still ambiguous for me, I kept searching, I found some other youtube videos that cover things like backpropagation deeper so I can understand it better.

Over time, I started taking a hold of it, running a couple of successful experiments, even if slow, they were functional, and I understood them.

After that, I turned it into a library (NeurologicalLibrary) that can be called from Python with Pybind11, I used tkinter to make a simple bounce ball environment just to test the library, and it worked! Just making a neural network that can get variable position of a ball and rectangle then predict where to go, despite simple, made me feel really proud.

That however, was just the below zero beginning, here is the project repo called "NAISENT_workspace" that is basically my entire learning journey work until I finally made my first ever Language Model!

https://github.com/Nai-built/NAISENT_workspace

The repository is under the Apache 2.0 License
Here is a copy of the README file:

this project is made with:
 - DotNet WinForms (C#)
 - Pybind11 (Python <-> C++23)
 - CMake (C++23)
 - CUDA (C++17)


Powershell commands to build the 3 libraries:
cd NeurologicalLibrary/bridge; cmake -S . -B build -A x64; cmake --build build --config Release -j; cd ../..
cd OptimizedNeurologicalLibrary; cmake -S . -B build -A x64; cmake --build build --config Release -j; cd ..
cd CudaNeurologicalLibrary; cmake -S . -B build -A x64; cmake --build build --config Release -j; cd ..


Run showcases:
py SHOWCASES/BASIC_SHAPE_RECOGNITION_CPU.py
py SHOWCASES/BETA_NAISENT_BALL_SEEKER_CPU.py
py SHOWCASES/LSTM_MATH_TEST_CPU.py
py SHOWCASES/NAISENT_ELM_CPU.py
py SHOWCASES/NAISENT_LM_CUDA.py
py SHOWCASES/NAISENT_SLM_CUDA.py
py SHOWCASES/SHAPE_RECOGNITION_CPU.py


Make sure that your terminal's path is set exactly to NAISENT_workspace


The core idea of this project was to learn and understand Machine Learning by building it from scratch
So I've built 3 different libraries in 3 seperate stages:
 - NeurologicalLibrary (NL)
    . The absolute beginning for me
    . I've learned in it how Dense Layers work and how to chain them to make Deep Neural Networks
    . How Convolutional Layers and pools work
    . How Recursive Layers (specifically LSTMs) work
    . And also Activation Functions
    . I've also tipped toes into Graph Layers but couldn't run a successful experiment, so I removed it
    . This library was the first time I made an image recognintion model, and also one that can play a simple bounce ball game
    . Was also the first time I made an optimizer like Adam for training
    . Save/load system for the model .json files


 - OptimizedNeurologicalLibrary (ONL)
    . Here things started to get a bit more serious
    . I've gotten way deeper into how C++ works and how we can optimize its performance
    . I've made faster Dense Layers
    . Faster Convolutional Layers
    . And faster LSTMs
    . Merged Activation Functions into the layers' own activation/gradient functions
    . After that, I got into Transformers (similar concept to Graph Layers, but this time it was successful!)
    . I optimized the training loop for image recognition
    . I made a simple experimental language model that can that it's "NAISENT" with the Transformer system I've made


 - CudaNeurologicalLibrary (CNL)
    . My most precious one so far
    . For the first time, I've got into Cuda kernels!
    . I've learned how Cuda interacts with data through the CPU, Memory and GPU
    . I've learned how to optimize it using shared memory
    . For this one, I went right ahead to build a language model system
    . First, I made Dense Layer Cuda kernels
    . Then I went into Norm Layers (RMS)
    . SCC (Sine/Cosine Cycle) positional embedding kernels
    . Multi-head Masked Self Attention kernels (split into multiple optimized Cuda files)
    . The ability to place sub chains to assemble the transformer architecture properly
    . Adam optimizer in Cuda Kernels
    . And obviously, Activation Functions (Cuda kernels)
    . First time adding the Residual mechanic as a visible variable in the Python side
    . Almost all of these were made in ONL already, but it wasn't with Cuda to use the GPU and it was juggled up together awkwardly. I'm much more proud of this one
    . Was when I made a proper tokenizer system in Python


The libraries are made in C++
and they're used by the Python side via Pybind11
I made the shape recognition and bounce ball environments in C# with WinForms
CUDA to use the GPU in the library CNL

r/FunMachineLearning • • Nov 30 '24

200,000 Trees Are Lit On Fire! (Simulation) - Two Minute Papers

Thumbnail
youtube.com
2 Upvotes

r/FunMachineLearning • • Oct 08 '26

My detector was too slow for a live stream, so I measured what happens when you stop waiting for it (latency 101 ms → 5 ms, and HOTA went up)

3 Upvotes

My detector takes about 80 ms on a CPU, and the camera gives a frame every 33 ms. A loop that waits for the detector shows boxes for where people were, not where they are.

I built a small tracking runtime to measure what happens when you stop waiting. With the detector in a background thread and optical flow moving the tracks between its results, mean output latency went from 101 ms to 5 ms, and HOTA went up from 32.9 to 34.5 (MOT17 train, YOLOX-s, laptop CPU).

A few things surprised me. Late detections must be moved forward to the current frame before you use them, or the score drops below the blocking loop. The biggest model was not the best one on a live stream. INT8 quantization helped more than all of my scheduling work. And a confidence-based trigger for the detector was no better than a fixed interval.

Write-up with the tables, charts and the things that did not work: https://yashbitla.com/blog/stopped-waiting-for-the-detector/

Code: https://github.com/yash-bitla/leantrack

Has a confidence-based trigger ever beaten a fixed interval for you? And does anyone correct late detections a different way?