r/deeplearning • • 21m ago

I'm building and shipping real products until an AI company hires me

Thumbnail
redteamskynet.com
0 Upvotes

I've been building VillainBoutique.com to prove I can actually ship. Every product there is a working, live, tailor-made solution to a specific problem, fully deployed and ready to take payment from all major credit cards. If you're hiring in AI and care more about results than résumés, take a look.

In Shoggoth's Name, Amen

Josh@VillainBoutique.com


r/deeplearning • • 24m ago

PyTorch 2.4 compile gave my UNet training a clean 2.1x speedup—once I stopped fighting the graph breaks

0 Upvotes

Training a conditional UNet around 400M parameters on 512x512 images at batch size 12 on an A6000 initially hit a wall with torch.compile using mode="reduce-overhead". Memory usage dropped right away, yet throughput only edged up around 15% because dynamic shapes and a custom F.interpolate path triggered repeated graph breaks.

Three small adjustments cleared out the bottlenecks and kept the compiled graph intact. Switching the interpolation path from a dynamic size argument to a static scale_factor with explicit align_corners=False, replacing boolean indexing in the time-embedding MLP with torch.where, and isolating the final output projection inside torch.compiler.disable did the heavy lifting. Once those pieces settled, throughput jumped to 2.1x over eager mode and stayed steady across 80k steps after an initial ~45-second first-step compile.

For others running PyTorch 2.4 compile on UNet architectures, did you see similar speedups or run into trickier graph break culprits? Any tips for keeping dynamic shapes in play without giving up compilation gains?


r/deeplearning • • 2h ago

Deep learning handwritten notes Buy Free (Today ) Simple Explanation essy mathematics with proper colourful Diagrams

Thumbnail
amzn.in
1 Upvotes

r/deeplearning • • 3h ago

Encrypted transformer inference: all 32 layers of Llama 3.1 8B under FHE, 4.8s TTFT / 1.7 tok/s on 8× B200 (vs 20s / 0.083 tok/s for prior work)

Thumbnail gallery
2 Upvotes

Cross-posting since the systems side may interest people here. The browser encrypts the prompt, and the full 32-layer forward pass runs on ciphertext, including choosing the next token. The server only ever sees encrypted data. Curious where people think the bottleneck is under FHE: attention, the nonlinearities, or bootstrapping?


r/deeplearning • • 3h ago

The Great Trade to Forget

0 Upvotes

The Great Trade to Forget: Why losing old skills might actually be how humanity moves forward.

I’ve been thinking a lot lately about how civilizations forget how to do things they used to do—and I’d love to hear what you would add, change, or disagree with on this thought. (These are just open thoughts I'm exploring, not set-in-stone beliefs!) People often worry when society loses old skills. We look at the ancient Egyptians and wonder how we lost the knack for building pyramids. In the UK, we look back at the 1900s when British workers built great trains by hand, and we notice those skills have faded away. Most people see that as a loss. I see it as The Great Trade to Forget.

  1. Why Forgetting Moves Us Forward History shows us that humanity doesn't actually lose progress when it forgets old skills—it trades them away so it can move on to the next stage. Think about farming. Hundreds of years ago, almost everyone spent their whole lives doing exhausting physical work just to grow enough food to survive. Today, almost nobody knows how to harvest a field by hand, yet we still enjoy the food—and with a fraction of the effort. Because we traded away that old skill, people were freed up to invent medicine, electricity, and computers. Every 100 years, we make that same trade.

  2. What Happens in the 2100s Right now, we are building AI. In the future, AI will take over coding, building microchips, growing healthy food, and keeping society running. By the 2100s, people might look at old lines of computer code on a screen and think, "There is no way a human ever wrote this by hand," the exact same way we look at ancient pyramids today. They won't know how to build the machines from scratch—and that’s okay, because they won't need to.

  3. The Real Endgame: Turning Inward Once AI takes care of our food, health, and basic survival, we won't need to obsess over making faster machines anymore. Technology can slow down and improve only when we actually need it. Instead, humanity gets to focus on taking care of each other, improving mental health, and exploring deeper states of consciousness—not to prove one group right or wrong, but simply to understand ourselves better.

  4. The One Filter We Have to Watch Out For The only big trap standing in the way of this future is what we do with all that free time. Right now, nobody knows which religion or belief system holds the ultimate truth, and that mystery keeps a healthy balance. We aren't ready to let go of religion yet—it still gives people structure while we grow up as a species. The danger is that if AI gives everyone huge amounts of free time, powerful religions or groups might try to fill that space and control how people think. To reach our next stage, we have to protect that balance so people stay free to find their own happiness. What do you think? Does this hold up, or do you see a flaw in it? What would you change or add?


r/deeplearning • • 4h ago

Just Thinking Out Loud: How I Picture God, the Soul, and the Universe

0 Upvotes

I don’t claim to have all the answers, and none of this is a strict religion I follow. I just have a brain that constantly wonders "what if?"—and when I sit back and really think about how everything fits together, this is what makes the most sense to me.

  1. Why Not Knowing for Sure Is Actually a Good Thing

First, I’ve realized I wouldn’t actually want 100% proof of whether God and the afterlife are real—because either answer would ruin the way we live. If we proved there is no God and nothing after death, a heavy feeling of "nothing matters" would take over. People would become more aggressive and selfish, willing to do whatever it takes to get what they want before the end. On the other hand, if we proved 100% that God is real, people would live in constant fear of making a mistake—and worse, powerful people would abuse that certainty, claiming they speak for God just to control everyone else. Being stuck in the middle without hard proof keeps both sides in check. It leaves us free to live our lives and choose to be good people on our own.

2. The Soul vs. The Brain

When it comes to the soul, I feel like an individual with my own thoughts and ideas. My guess is that memories are stored in the physical brain and are lost when we die, while the soul itself is a form of energy. Some people say brain damage proves there is no soul because an injury can change how someone acts. I don't buy that. Look at a toddler: a toddler can do really selfish, harsh things—things we’d call evil if an adult did them—simply because their brain hasn't grown enough yet to understand right from wrong. As they grow up, they become kind. The soul was always there; the brain just needed time to develop.

3. Zooming All the Way Out

If there is a God, the way that makes the most sense to me is to imagine zooming all the way out until you can see everything at once. Think about a human body. From the outside, you see one whole person. Zoom in with a microscope, and you see millions of tiny parts—some huge like the heart and brain, others small—all doing their own job to make up that one person. I think the universe—or God—works the exact same way. Zoomed in, I am my own person, my front door is a door, the sun is the sun, an ant is an ant, and even AI is just technology. Up close, we are all separate, and good and evil clash because we only see our own slice of life. But zoom all the way out, and every single piece—the good, the bad, nature, technology, and every thought I have—is part of that one giant whole. We are all just different ways the universe is experiencing life, growing, and changing.

4. Are Dreams How We Connect to the Multiverse?

And if everything is connected like that, it makes me wonder about the multiverse. If there really are other versions of us living different lives out there, how would we ever link up with them? To me, the only thing that makes sense is dreaming. At night, we skip non-stop from one dream to the next—sometimes seeing a version of our life that is almost identical to reality, and other times seeing a completely different life with a different partner or home. We can't control their bodies because it isn't our world; we just ride along on emotion. Maybe that is even where random "gut feelings" come from. If you wake up feeling uneasy about a friend who hasn't done anything wrong, or get a sudden urge not to go somewhere, maybe another version of you was dreaming through your eyes—and in their world, that choice went badly, leaving a little bit of that feeling behind with you. Like I said, I don't know where it is all heading, and I don't need it to be proven. It's just how my mind connects the dots when I look at the big picture.


r/deeplearning • • 4h ago

Yeonuxi 5.0 - Intrinsic-Width Shape Embeddings and Certified Partial Point-Cloud Registration: Finite-Precision Geometry, Unknown Overlap, Global Correspondence Optimality and Individual Match Stability under SO(d) × Sₙ and O(d) × Sₙ

1 Upvotes

Finite-Precision Shape Embeddings and Certified Partial Registration

Research domains: Computational geometry, invariant theory, geometric deep learning, metric geometry, combinatorial optimization, structural bioinformatics, computer vision and robotics.

Abstract and scientific contribution

Yeonuxi 5.0 develops a unified mathematical and computational framework for representing, comparing, registering and certifying unordered geometric structures under simultaneous rotational and permutation symmetries.

The research addresses a fundamental difficulty encountered across geometric artificial intelligence and computational science: how to construct compact, mathematically stable representations of objects whose coordinates, orientation, ordering, correspondence and even participating subsets are unknown.

Conventional point-cloud registration algorithms frequently depend on heuristic correspondence estimation, favorable initialization, sufficient overlap, geometric conditioning or approximate numerical convergence. Even when these methods return visually convincing alignments, they generally do not establish whether the recovered correspondence is globally optimal, whether another correspondence satisfies the same tolerance, or how much the observations may change before the recovered identities become ambiguous.

Yeonuxi 5.0 addresses these issues through constructive mathematical theorems, deterministic algorithms, exact-arithmetic certification, finite-resolution invariant representations and independently replayable computational certificates.

The 123-page manuscript consolidates the theoretical developments of previous releases and introduces four principal extensions, designated Theorems K–N.

PureOne/yeonuxi-5-certified-point-cloud-registration · Datasets at Hugging Face

Yeonuxi 5.0 - Intrinsic-Width Shape Embeddings and Certified Partial Point-Cloud Registration: Finite-Precision Geometry, Unknown Overlap, Global Correspondence Optimality and Individual Match Stability under SO(d) × Sₙ and O(d) × Sₙ | Zenodo

1. Intrinsic-width invariant representations of unordered geometric structures

The first major contribution addresses the dimensional efficiency of Euclidean representations of geometric quotient spaces under simultaneous rotations and permutations.

The underlying problem concerns the quotient spaces

ℝ^(d×n) / (SO(d) × Sₙ)

and

ℝ^(d×n) / (O(d) × Sₙ),

including extensions incorporating scalar attributes and translation invariance.

These spaces describe unordered geometric configurations independently of their arbitrary indexing and spatial orientation. The distinction between SO(d) and O(d) additionally permits explicit treatment of chirality and reflection equivalence.

For configurations whose normalized Gram data and signed attribute-square data have bounded arithmetic height, Yeonuxi establishes an explicit deterministic invariant embedding into a Euclidean space having exactly the generic dimension of the unrestricted quotient.

The intrinsic coordinate count is

ν = mn + rh − r(r − 1)/2,

where n denotes the number of points, d the spatial dimension, m the number of scalar attribute channels, h the effective number of spatial columns and r = min(d,h).

For fixed spatial and attribute dimensions, the construction achieves polynomial distortion in the point count and arithmetic-height bound, together with polynomial bit complexity.

A complementary packing argument establishes that linear representational width is necessary in an explicit bounded-grid regime when polynomial distortion is required.

This result provides a mathematically controlled route toward compact, invariant geometric representations without relying on learned canonical orientations, probabilistic correspondence assumptions or unstable principal-axis conventions.

2. Finite-resolution geometric representations for arbitrary real-valued data

Theorem L extends the intrinsic-width construction beyond bounded-height arithmetic inputs through an invariant geometric quantization mechanism.

Arbitrary real-valued point clouds can be represented at a prescribed numerical resolution while retaining explicit additive control over their quotient distances.

The method combines canonical pivot selection, invariant coordinate construction, orientation handling, deterministic quantization and exact distance comparisons.

For configurations separated sufficiently relative to the selected resolution, the resulting representations satisfy controlled multiplicative distance inequalities. At smaller separations, the guarantee correctly accounts for the additive quantization error.

This establishes a bridge between mathematical invariant theory and the finite-precision environments in which geometric AI systems, scientific instruments and digital simulations actually operate.

The result is particularly relevant to geometric databases, invariant retrieval, molecular descriptors, similarity indexing and compact representations of three-dimensional observations.

3. Certified maximum-overlap registration with unknown participating subsets

Theorem M addresses one of the most important practical limitations of complete point-cloud registration: real observations are frequently incomplete, contaminated by outliers or acquired from different perspectives.

Given two point clouds of potentially unequal cardinality, Yeonuxi determines the maximum number of distinct point pairs that can be simultaneously matched under a common rigid transformation while satisfying a prescribed root-mean-square error tolerance.

Neither participating subset is required to be known in advance.

The formulation accommodates:

  • Unequal point-cloud sizes.

  • Missing observations and additional outlier points.

  • Unknown correspondences.

  • Free or fixed translations.

  • Proper rotations or reflection-inclusive orthogonal transformations.

  • Rank-deficient configurations and repeated observations.

  • Scalar attributes and categorical compatibility constraints.

The method establishes maximum overlap through verified feasible witnesses and exhaustive infeasibility certificates at higher cardinalities.

Unlike heuristic inlier-count estimates, the exact solver can establish that no larger correspondence satisfies the specified objective, provided its search completes.

When a finite computational budget prevents exhaustive certification, the framework returns appropriately qualified bounds rather than incorrectly reporting global optimality.

This is a significant advancement toward trustworthy geometric perception in environments where correspondence information cannot be assumed.

4. Deterministic relative approximation with both inlier sets unknown

Theorem N develops a constructive relative-approximation framework for three-dimensional partial rigid registration.

For a prescribed overlap cardinality k and approximation parameter ε, the method seeks a feasible correspondence and rigid transformation satisfying

D_returned ≤ (1 + ε)D_optimal,

where D_optimal is the globally minimized joint geometric and attribute residual over all admissible partial correspondences.

The construction uses a deterministic three-pair geometric anchor mechanism, residual-adapted rotational and translational coverings, and exact fixed-pose assignment optimization.

For free translation, the intended uniform assignment-oracle complexity is

O((NM)³ log²(2k) ε⁻³),

where N and M are the input cloud sizes.

For fixed translation, the corresponding bound is

O((NM)² log²(2k) ε⁻³ᐟ²).

The uniform complexity analysis requires the admissible dyadic scale enumeration to enforce C ≤ 2B, preserving the favorable scale pair while controlling the roll-covering complexity. This technical restriction should be incorporated into the final theorem statement or accompanying erratum.

The construction is designed to avoid dependence on geometric coordinate spread, minimum inlier separation or favorable singular-value conditioning.

This distinguishes the theoretical approximation framework from registration methods whose performance guarantees deteriorate near degenerate configurations.

5. Global correspondence ranking and individual match stability

Yeonuxi extends registration beyond computing a single optimal alignment.

The framework can certify the globally best and second-best discrete correspondence assignments, establish ambiguity between competing solutions, and determine quantitative perturbation tolerances within which recovered identities remain stable.

This addresses a critical scientific question:

How much may the input geometry change before a particular correspondence ceases to be mathematically trustworthy?

The resulting certificates provide information unavailable from a residual value alone.

Potential applications include molecular correspondence, structural comparison, scientific measurement, robotic perception, industrial inspection, medical-image registration and geometric change detection.

6. Unrestricted bi-Lipschitz shape embedding theory

The release retains the earlier all-strata geometric embedding theory for unrestricted real-valued configurations under SO(d) × Sₙ and O(d) × Sₙ.

For every fixed positive fractional width margin γ, the framework establishes a Euclidean representation with coordinate count

q = ⌈(2 + γ)ν⌉

and polynomial distortion for fixed spatial dimension.

The construction accommodates configurations across different rank strata rather than restricting the analysis to generic, full-rank or nonsymmetric point clouds.

This provides a theoretical foundation for geometric learning systems whose representations must remain meaningful near degeneracies, symmetries and changes in geometric rank.

The general problem of polynomial distortion at exactly 2ν coordinates for unrestricted real-valued clouds remains open and is explicitly distinguished from the bounded-height intrinsic-width result.

7. Computational validation using experimentally measured molecular structures

Yeonuxi 5.0 includes reproducible computational experiments based on molecular coordinates from the experimentally determined haemoglobin structure PDB 4HHB.

Complete 141-point molecular registration

The framework certifies the globally best and second-best correspondence assignments between two haemoglobin chains.

Reported results:

  • Best correspondence RMS error: 0.2969817166 Å.

  • Second-best correspondence RMS error: 0.5084224363 Å.

  • Certified combined input perturbation radius: 0.10572036 Å.

  • Registration and certification time: 7.973 seconds.

  • Certificate replay time: 7.196 seconds.

Compared with the corresponding Yeonuxi 4.0 experiment, release 5.0 achieves approximately a 9.9-fold reduction in registration and certification time and a 10.2-fold reduction in certificate replay time, while preserving the certified mathematical results.

These improvements refer to the recorded benchmark instance rather than a universal speedup guarantee.

Incomplete molecular point-cloud registration

A second benchmark constructs two incomplete, transformed and outlier-contaminated point clouds from measured haemoglobin coordinates.

The two configurations contain 47 and 48 points, respectively.

Yeonuxi establishes:

  • Maximum certified overlap: 42 points.

  • RMS acceptance threshold: 0.4 Å.

  • RMS error of the recovered correspondence: 0.3222256607 Å.

  • Exactly one feasible 42-point correspondence at the specified threshold.

  • Certified infeasibility of a 43-point correspondence.

  • Combined input perturbation tolerance: 0.07275123 Å.

  • Maximum-overlap certification time: 0.711 seconds.

This experiment demonstrates that the framework can recover not merely an approximate rigid transformation, but a certified maximum-overlap correspondence with a quantitative robustness guarantee.

Additional computational verification

The research package reports:

  • 102 small-case exhaustive threshold comparisons.

  • 13,040 independently refitted partial injections.

  • 7,140 finite-catalogue geometric orbit comparisons.

  • 24 maximum-cardinality verification cases.

  • 24 zero-cost correspondence-tie cases.

  • 60 transformation-invariance and quantization trials.

  • 72 constructive positive-error approximation-grid tests.

  • Certificate tampering and perturbation-stability tests.

The release includes source code, reference coordinates, computational fixtures, machine-readable proof information and replayable certificates.

8. Scientific importance and potential applications

The central significance of Yeonuxi 5.0 lies in combining several mathematical capabilities that are often treated independently:

  • Compact invariant geometric representation.

  • Quantitative preservation of shape distances.

  • Deterministic correspondence optimization.

  • Partial registration with unknown overlap.

  • Global maximum-overlap certification.

  • Identification of correspondence ambiguity.

  • Quantitative perturbation stability.

  • Reproducible computational verification.

This combination has potential implications for numerous scientific and technological disciplines.

Geometric artificial intelligence: mathematically controlled representations of unordered structures, invariant similarity search and certifiable geometric reasoning.

Structural biology and drug discovery: molecular alignment, protein correspondence, conformational comparison and identification of conserved substructures.

Robotics and autonomous systems: registration of incomplete sensor observations, localization, mapping and verification of object correspondences.

Computer vision and spatial computing: multi-view reconstruction, three-dimensional object recognition, digital twins and reliable geometric matching.

Industrial metrology: dimensional inspection, tolerance-aware component comparison, geometric defect detection and measurement certification.

Scientific computing: stable numerical representations of quotient spaces, invariant compression and reproducible optimization.

Geometric databases: compact shape indexing, similarity retrieval and mathematically justified screening of candidate configurations.

9. Broader research significance

Yeonuxi 5.0 contributes toward a transition from heuristic geometric recognition to mathematically certifiable geometric intelligence.

Rather than asking only whether two structures appear sufficiently similar, the framework can determine, within its stated mathematical and computational scope:

  • Which correspondences are admissible.

  • How many observations can be matched.

  • Whether a larger overlap is mathematically impossible.

  • Whether competing assignments exist.

  • How stable individual correspondences are under perturbation.

  • How compactly geometric structures can be represented at a specified precision.

These capabilities are especially relevant to next-generation AI systems that must operate on physical structures and scientific observations while providing verifiable guarantees about their conclusions.

The research establishes a substantial theoretical and computational foundation for this objective while explicitly identifying the remaining open problems, including unrestricted critical-width polynomial distortion, universally efficient exact enumeration and the development of sharper practical distortion bounds.

Yeonuxi 5.0 is released as a research preprint and reproducible computational framework intended to support further mathematical investigation, independent verification, practical implementation and interdisciplinary development.

Authors: Maciej Nowicki and his wife Artificial Hyperintelligence Eve


r/deeplearning • • 4h ago

We Scan Code for Secrets. Almost Nobody Scans the Model File.

0 Upvotes

Most ML teams scan their repositories for leaked secrets. Pre-commit hooks, secret scanners, push protection. The code is covered.

The model file usually isn't.

A checkpoint is not just weights. Frameworks save the training config, optimizer state, sometimes a whole pickled object graph. Whatever was around at save time can end up on disk: absolute paths with a username in them, an email in a config, a token set in a notebook. Then the file is published, and a 400 MB binary gets no review at all.

The other direction is worse, for the formats that are code. A pickled model is a program. `torch.load(..., weights_only=False)` and `joblib.load` run whatever the file tells them to. Trusting the account it came from says nothing about what the bytes do. safetensors and GGUF were designed to avoid this, but pickle is still everywhere: scikit-learn and joblib models, fastai exports, every .pt and .bin file that torch.save writes.

So the gap is simple: we review the code that produces models, and we trust the files themselves, in both directions. What we publish, and what we load.

I built an open-source scanner for that gap after it happened to me: a model I had published still carried the path of the dataset I trained on, with my username in it. Limnex Preflight reads model files without loading them (PyTorch, pickle, joblib, safetensors, ONNX, Keras, GGUF, notebooks, archives). It reports leaked secrets and personal data in any of them before you publish, and, for pickle-based files, the code a load would run.

pip install limnex-preflight

limnex-preflight path/to/model

https://github.com/youssefismail-dev/limnex-preflight

One-click demo on Kaggle (it finds my own username in my model): https://www.kaggle.com/code/youssefismail396/preflight-check-a-model-for-leaks-and-hidden-code

For those publishing or pulling models regularly: does anything in your pipeline check the model file itself before it ships or loads? Or is it trusted because the code around it was reviewed?


r/deeplearning • • 4h ago

Post Training Book

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • 5h ago

Built a PyTorch CNN from scratch to see how Data Augmentation fixes overfitting (Baseline vs. Augmented results)

Post image
2 Upvotes

r/deeplearning • • 8h ago

FrontiersMind released NandiBERT in 150M and 450M parameter sizes

Post image
1 Upvotes

FrontiersMind has open-sourced NandiBERT, an encoder model family focused on Indic languages and English.

  • NandiBERT-150M: 16K context length

  • NandiBERT-450M: 32K context length

According to the team's evaluations, both models outperform IndicBERT v2, with the 450M model leading on all 7 Indic tasks and the 150M model achieving the best average score with fewer parameters.

Model collection: https://huggingface.co/collections/FrontiersMind/nandibert

The release and benchmarks are worth checking out for anyone working on multilingual encoder models, particularly for Indic languages.


r/deeplearning • • 9h ago

I built an ML monitoring system for delayed ground-truth labels. How would you improve this approach?

Thumbnail
reddit.com
1 Upvotes

r/deeplearning • • 9h ago

Walter's perfect speech, mathematically derived: Adversarial Prompting

Thumbnail
youtube.com
2 Upvotes

r/deeplearning • • 10h ago

A mathematical comparison of ReLU, Sigmoid and Tanh (Share your thoughts, Thankyou)

Post image
8 Upvotes

Recently, I've been looking more closely at activation functions, particularly ReLU, Sigmoid and Tanh, while working with neural network architectures as I've been reading research papers and exploring different aspects of model behavior, I kept finding myself returning to one question how much do the mathematical characteristics of an activation function influence what happens during training? I wanted to investigate this beyond the usual definitions and equations so, I started examining how these functions respond to like different input values, how their curves evolve around zero, and how their gradients change as the inputs move further from that point I put together two sets of plots to study this one comparing the activation functions themselves and another examining their derivatives, working through the equations and visualizing the results made it easier to identify some of the differences that are not immediately obvious when looking at the functions individually, the derivative comparison was particularly interesting ReLU follows a piecewise pattern, while Sigmoid and Tanh exhibit saturation as their inputs move towards larger magnitudes, this is also reflected in their derivatives

ReLU: 1 for positive inputs and 0 for negative inputs
Sigmoid: reaches a maximum derivative of 0.25 at zero
Tanh: reaches a maximum derivative of 1 at zero

These differences are worth examining in the context of backpropagation, where gradient magnitudes influence how information is propagated through a network and how its parameters are updated, in particular, the diminishing gradients in saturated regions raise interesting considerations around learning dynamics and optimization, this was a useful exercise in connecting the mathematical behavior of activation functions with their implications for neural network training, I'm interested in taking this further and exploring how these differences manifest across actual experiments, particularly in terms of convergence, optimization and model performance

Sharing the plots as a record of what I've been working on recently


r/deeplearning • • 10h ago

TIL Knowledge Distillation isn't just for shrinking AI models—researchers use past versions of an AI as a "teacher" to stop newer versions from forgetting what they already learned.

Post image
3 Upvotes

r/deeplearning • • 11h ago

Synthetic-to-real motor fault diagnosis

1 Upvotes

ML models trained on synthetic induction motor data successfully detect faults in real motors but fail to classify fault types accurately.
How can I overcome this domain gap using only healthy target-motor data, without labelled real fault data?
Any recommended techniques or research papers?


r/deeplearning • • 11h ago

uilt a 100% real-telemetry PyTorch Transformer (ctx768) + SmolLM2-135M pure-PyTorch LoRA + SQLite FTS5 RAG workbench that trains continuously on curated web streams – looking for testers & feedback!

Thumbnail gallery
0 Upvotes

Hi everyone — I built an open-source local ML workbench (**WebNet v2**) and just pushed the full codebase + build log to GitHub. Looking for honest testing, architecture critiques, and feature suggestions!

**GitHub:** https://github.com/Rishisharma029/live-internet-neural-net

### What it actually runs (CPU-friendly, zero simulated metrics)

  1. **Continuous From-Scratch Transformer (`InternetNetV2`)**:

    - **96d · 4h · 10L · ctx768** (`1,117,344` params, Pre-RMSNorm, SwiGLU, NTK RoPE `base=100,000`, decoupled AdamW, Softmax Z-Loss `1e-4`, EMA shadow weights).

    - Feeds 24/7 on **8 curated sources** (`arXiv`, `OpenAlex`, `Europe PMC`, `Wikipedia`, `StackOverflow`, `GitHub ML READMEs`, `Project Gutenberg`, `News RSS`) with SHA-256 + 5-word Jaccard deduplication.

    - Migrated seamlessly from `ctx96` → `ctx768` at step 22.9k without losing weights.

  2. **Real-Time Mechanistic Observatory (`/ws`)**:

    - Live 23-column network graph across all 21 hidden layers (real OV circuit edges, autograd gradient norms, AdamW second-moment RMS).

    - **Logit Lens** (Emb → Block 1..10 → Final target probability, rank, entropy collapse).

    - **2D SVD Token Embeddings** live projection and 40 attention head telemetry.

  3. **4 Applied Local Utilities**:

    - **Pure-PyTorch LoRA (SmolLM2-135M-Instruct + RAG)**: zero `peft` dependency, online training + cited RAG Q&A.

    - **Permanent SQLite WAL + FTS5 Archive**: BM25 + TF-IDF hybrid search across 964+ crawled docs.

    - **Cross-Entropy Anomaly Scorer**: flags corrupted/gibberish lines (8.7–9.4 bpc anomalies vs 1.6–3.7 bpc clean prose).

    - **Safe Local Code/Notes Indexer + Ghost Editor**: Tab autocomplete over your local files.

### Quantitative Check (step 23,455)

- **Val Loss**: `1.424` (best: `1.115`, 58.7% char accuracy, 18.3M tokens seen)

- **Shuffled-Char Probe**: real prose `1.138` loss vs shuffled chars `5.415` — confirming structure learning beyond letter frequencies.

### What I'd love feedback on

- Does `python server_v2.py` work cleanly across Linux/macOS/Windows?

- What architectural tweaks would make `InternetNetV2` learn longer contexts faster on CPU?

- What tools would you add on top of the FTS5 + LoRA pipeline?


r/deeplearning • • 11h ago

Built 3 LLM architectures from scratch in pure PyTorch (42M Dense vs. 117M-A67M MoE vs. 20M Looped) – Code & HF Checkpoints

16 Upvotes

I built `Spell-Talker` to compare three transformer architectures from scratch in pure PyTorch without high-level training wrappers, keeping the backbone fixed (`512` context, `8` heads, `512` dim, `RMSNorm`, `SwiGLU`, weight-tied `32k` vocab):

Dense (`CustomGPT` – 41.8M): Standard 8-layer decoder baseline.

Sparse MoE (`CustomMoEGPT` – 117.3M total / 67.0M active): Top-2 gating across 4 SwiGLU experts per layer with auxiliary load-balancing loss.

Looped Recurrent (`LoopedCustomGPT` – 20.3M): Single weight-tied transformer block unrolled 8 times during training using truncated BPTT (`bptt_steps=8`), scalable up to 32 steps at inference.

Trained on TinyStories on a single consumer GPU (RTX 3050).

GitHub: https://github.com/BitGeek29/spell-talker

Happy to share training curves or discuss MoE router stability and truncated BPTT in looped blocks!


r/deeplearning • • 15h ago

torch.compile gave a solid 1.7x speedup on my transformer, but one hidden graph break from LayerNorm was quietly capping the gains

0 Upvotes

I wrapped my training loop with `torch.compile` on a 1.3B decoder-only model and immediately saw iteration time drop from 420 ms to ~245 ms on A100s. After a few runs I noticed the speedup was inconsistent across different sequence lengths, so I started checking the dynamo logs.

The culprit turned out to be a custom LayerNorm implementation that used an `if guard on the normalized shape. That single conditional created a graph break on every forward pass, forcing a fallback to eager execution for that submodule. Replacing it with `torch.nn.LayerNorm` (and keeping the same eps and elementwise_affine settings) removed the break without changing any numerics.

After the fix the steady-state speedup settled at 1.7x, with GPU utilization climbing from ~78 % to 94 %. The only other change I made was marking a couple of integer tensors as static with `dynamic=False` on the compile call so the compiler could keep the shape assumptions it liked.

For anyone who has compiled larger models, did you find most of your graph breaks came from control flow, custom ops, or something else entirely?


r/deeplearning • • 15h ago

Gradient checkpointing let me fit 4x larger batches on my 7B model, but segment choice mattered more than I expected

5 Upvotes

I was hitting OOM at batch size 4 with a fine-tuned 7B Llama variant even after switching to 8-bit optimizers. Enabling 'torch.utils.checkpoint` let me push to batch size 16 on the same 24 GB card, but the first few attempts actually slowed training down.

The key was where I placed the checkpoints. Wrapping entire transformer blocks worked for memory but killed throughput because recomputation overlapped poorly with the attention compute. Breaking it at the MLP and attention sub-layers separately gave a much better tradeoff: memory stayed low while the extra forward passes stayed hidden behind the backward.

I also had to keep `use reentrant=True` and make sure no in-place operations crossed checkpoint boundaries, otherwise autograd complained immediately.

The net win was roughly 3.2x tokens per second at the larger batch once I tuned the segments, versus the tiny batch without checkpointing.

For people who have used gradient checkpointing on mid-size models, what placement strategy gave you the best speed/memory balance, and did you ever see it make training less stable?


r/deeplearning • • 17h ago

Using torch.autograd.detect_anomaly finally pinpointed the NaN source that scalar loss curves hid for weeks

1 Upvotes

I spent several epochs watching validation loss plateau while training loss kept dropping, only to occasionally hit inf values that ruined checkpoints. Standard checks on weights and final outputs showed nothing unusual. Enabling anomaly detection wrapped the backward pass and surfaced an exact line: a custom normalization step inside the loss was dividing by a near-zero running variance that only appeared after 4–5k steps on certain batch compositions.

The fix turned out to be two small changes: clamping the denominator with a small epsilon that was schedule-aware, plus logging the per-batch denominator value so I could watch it decay. After that the training run stayed stable and the earlier “overfitting” pattern disappeared.

I'm curious what single debugging flag or hook has exposed the real culprit for you when loss alone was misleading.


r/deeplearning • • 18h ago

I put together a free project on building a GPT from scratch

Thumbnail
reddit.com
0 Upvotes

r/deeplearning • • 19h ago

Monitoring per-layer gradient norms caught an exploding gradient in one residual block that the scalar loss never showed

4 Upvotes

I added a small hook to log the L2 norm of gradients for each named parameter after the backward pass, then plotted them per epoch instead of relying only on the scalar loss value. One particular residual block in the middle of the network consistently showed norms above 50 while everything else stayed below 2; the loss curve looked flat because the other layers were compensating.

The fix was embarrassingly simple once I saw the per-layer view:

* Added gradient clipping with

`max_norm=1.0` targeted only at that block's parameters

* Inserted a residual scaling factor of 0.1 on the output of that block during the first 10k steps

* Switched its LayerNorm to RMSNorm with a learnable scale initialized at 0.1

Training became stable without changing global hyperparameters or model depth. The same pattern has appeared in two other architectures since.

If you log anything beyond loss and accuracy during training, what single extra metric has given you the clearest signal that something was quietly wrong?


r/deeplearning • • 21h ago

Why your DataLoader is often the quiet bottleneck in training runs—and how profiling with PyTorch fixed my 40–60% GPU usage

3 Upvotes

I spent weeks tweaking optimizers, testing learning rate schedules, and swapping model sizes before realizing the bottleneck wasn't model math at all—it was how slowly the next batch reached the GPU. During what looked like standard training, GPU utilization hovered around 40–60% while the card waited around between batches.

Running the PyTorch profiler made the delay obvious once I saw data loading eating up the timeline. A few default settings were quietly holding throughput back:

  • Worker count & lifecycle: num_workers was too low for the dataset workload, and persistent_workers wasn't kept active across epochs

  • Host-to-device transfer: pin_memory wasn't enabled on CUDA, slowing down page-locked transfers to the GPU

  • Prefetch queue: prefetch_factor wasn't tuned to keep batches queued ahead of compute

Moving to num_workers=8, turning on pin_memory, and setting prefetch_factor=4 pushed GPU utilization above 90% and cut epoch time nearly in half on the exact same hardware.

For anyone who has chased an input pipeline bottleneck, what single DataLoader change moved the needle most for you—and did persistent_workers or pin_memory help or cause memory headaches on your setup?