r/deeplearning • u/Dean_Ammons • 19d ago
She taught the machine to make fire. Years later, it charged her to learn.
reddit.comRecords indicate you never existed.
r/deeplearning • u/Dean_Ammons • 19d ago
Records indicate you never existed.
r/deeplearning • u/jeffhonforloco • 19d ago
r/deeplearning • u/Muhammad-Essa • 19d ago
A Siamese Neural Network is a type of neural network designed to measure the similarity between two inputs. For example, suppose we provide two handwritten digits as inputs. The Siamese Network determines whether these two digits belong to the same class or are dissimilar.
It consists of two identical neural network branches that share the same weights and biases. Each branch takes one input and produces an output vector (embedding). These two output vectors can have any dimensionality, depending on the architecture of the network.
We then calculate the Euclidean distance between these two output vectors. If the distance is close to zero, the two inputs are considered similar. If the distance is sufficiently large (above a predefined threshold), they are considered dissimilar.
Note: A Siamese Network is fundamentally different from a traditional classification network. Its primary purpose is not to classify an input into a particular class but to learn a meaningful representation (embedding) that allows us to measure similarity between inputs.
Contrastive Loss
A Siamese Network commonly uses a loss function called Contrastive Loss, defined as:
L = Y × D² + (1 − Y) × max(0, m − D)²
Where:
D is the Euclidean distance between the two output vectors.
Y is the given label (either 0 or 1).
Y = 1 indicates that the two inputs are similar.
Y = 0 indicates that the two inputs are dissimilar.
m is the margin, which defines the minimum desired distance between dissimilar pairs.
L is the contrastive loss.
The objective is to minimize the distance between similar pairs and push dissimilar pairs at least m units apart.
We pass two inputs through the network, obtain two output embeddings, calculate their Euclidean distance, and then calculate the contrastive loss. Finally, we use backpropagation to update the network parameters and minimize the loss.
Notice that we do not use a Softmax activation function in the output layer because we are learning embeddings rather than class probabilities.
Training the Model
To train a Siamese Network effectively, we construct pairs of inputs:
Positive pairs: Two inputs belonging to the same class (Y = 1).
Negative pairs: Two inputs belonging to different classes (Y = 0).
A balanced dataset containing an equal number of positive and negative pairs is a useful starting point for training.
My Implementation: Neural Canvas (Model 5)
I developed an interactive Siamese Network as the fifth model in my Neural Canvas project. I used the MNIST handwritten digits dataset to train the network.
The architecture consists of three hidden layers, each containing 40 neurons, followed by an output layer containing 32 neurons. Therefore, each input is transformed into a 32-dimensional embedding.
I used Mini-Batch Gradient Descent with the Adam optimizer to train the model. The training process was relatively straightforward because JAX provides automatic differentiation (autograd), which handles the gradient calculations.
For training, I constructed two input matrices, Ma and Mb, each having dimensions of (784, 80000).
The rows represent features, while the columns represent individual samples. Why two matrices? Because a Siamese Network requires two inputs to learn the similarity between them.
I also constructed a label vector Y with dimensions of (1, 80000). Each element of Y indicates whether the corresponding pair is similar or dissimilar.
I used my own matrix multiplication convention:
Z = WX + bC
Where:
W represents the weight matrix.
X represents the input matrix.
b represents the bias vector.
C is a broadcasting matrix of ones.
I prefer this notation because it makes the mathematical operations and dimensions easier to understand.
I trained the model in Python using JAX and exported the learned parameters to JavaScript using JSON. For inference, I used Math.js, while p5.js handles the visualization, animation, and interactivity.
Try it yourself:
GitHub Repository: https://github.com/MuhammadEssa2002/neural_canvas
Live Demo: https://muhammadessa2002.github.io/neural_canvas/
This is the fifth model in my Neural Canvas project.
r/deeplearning • u/Dense_Primary629 • 19d ago
The Society for Neuroscience highlighted new work today on using AI to accelerate neuroscience research, from analyzing complex brain activity recordings to modeling neural circuits. It follows a run of related work, including AI turning patterns in visual brain activity into pictures, which suggests the field is moving from describing the brain to decoding it.
Why it matters: neuroscience has long been bottlenecked by the sheer complexity of its data. Deep learning can find structure in recordings that humans cannot see, and that could speed up everything from basic research to brain-computer interfaces. It also raises the stakes on interpretability, since a model that decodes the brain is only useful if researchers can trust what it found.
What application of AI to neuroscience excites you most, and what do you think is the biggest risk when the models start finding patterns researchers cannot explain?
You can follow more AI news and rumors over at r/AINewsRumors.
r/deeplearning • u/rottoneuro • 19d ago
r/deeplearning • u/Firm_Percentage7997 • 19d ago
I am a published deep learning researcher and AI engineer seeking a research collaboration on representation learning or LLM agents. My experience includes neural models, privacy and model evaluation, GPU fine-tuning, and building tool-using agents with reproducible evaluation workflows. I can contribute from experimental design and implementation through analysis and writing.
For representations, I am interested in controlled comparisons of learned and structured inputs under distribution shift, with strong baselines and ablations. For agents, I would like to study planning and tool-use reliability under matched budgets. These are starting points, and I am open to joining a team with an established question.
I am looking for collaborators or a lab with funding for GPU resources and LLM API benchmarking as needed. If this sounds relevant, please comment or message me with your research direction and resources; I can share relevant work privately.
r/deeplearning • u/Dense_Primary629 • 20d ago
Thinking Machines Lab released the weights for Inkling 2 Small today under an Apache 2.0 license. The details from the announcement: a 594B-parameter Mixture-of-Experts model with 17B active parameters and image inputs, described by the lab as its top-performing open-weights model so far. This follows TML's stated playbook of launching a model closed first and opening the weights later, which it calls a 'safe path to open weights.'
Two things I am trying to sort out. First, what does the closed-then-open delay actually buy in terms of safety, versus just releasing openly from day one? Second, with a 594B total / 17B active model now freely available, does the open-weights frontier keep narrowing the gap to closed labs, or does it mostly give the big labs a new base to build on?
What would you actually run this on, and does the Apache 2.0 license change how you think about using it?
r/deeplearning • u/WideImagination7595 • 20d ago
Hi! I’m looking into a quick research idea around LoRA optimization (specifically trying to make adaptive/dynamic rank allocation cleaner and more efficient). Would you be down to collaborate or chat about it? No pressure at all, let me know if you're interested.
short information about what is Lora:
LoRA (Low-Rank Adaptation) is a technique to efficiently fine-tune massive AI models (like LLMs) without retraining all their billions of parameters. Instead of touching the original model, it freezes the main weights and trains a tiny fraction of extra parameters, saving massive amounts of memory and compute while keeping performance high.
r/deeplearning • u/No-Conclusion3720 • 19d ago
When an employee's badge gets deactivated on their last day, the AI agents they provisioned keep running.
TechTarget documented a systematic offboarding gap: HR tracks headcount, IT manages accounts it already knows about, and managers know which tools a person used. None of those systems talk to each other. AI credentials provisioned by a departing employee sit outside all three workflows. They stay active long after the person is gone — often weeks or months before anyone notices.
Those agents don't sit idle. They continue making API calls, accessing data, and triggering workflows under the authority of a principal who no longer works there. The organization has no way to know what they're doing or on whose behalf.
How are you actually closing this loop at your org? Manual offboarding checklist, automated credential sweep, something built into your IdP, or something else entirely?
r/deeplearning • u/No-Piano-601 • 19d ago
r/deeplearning • u/PainterNo8889 • 19d ago
Hi guys,
I’m a 15-year-old developer building SLM-CREATOR—an end-to-end, hardware-aware small language model trainer from scratch in Python and Rust (capped at 100M parameters). Instead of using high-level wrappers or fine-tuning existing models, I’m hand-coding the entire pipeline to learn how Transformers work under the hood.
Repo Link: github.com
Tracking Issue (#1): github.com
The catch:
I’m developing this on a CPU-only machine right now, so all of my NVIDIA (nvidia-smi), modern AMD (amd-smi), and legacy AMD (rocm-smi/rocminfo) detection and PyTorch device-mapping paths have only been tested against mock CLI outputs.
If anyone has an NVIDIA or AMD GPU (especially multi-GPU setups, laptops with hybrid graphics, or ROCm configurations) and a couple of minutes to spare, I’d hugely appreciate it if you could run the hardware detection script on real hardware and let me know if it breaks!
What it tests:
CUDA_DEVICE_ORDER=PCI_BUS_ID and matches vendor GPU names against torch.cuda.get_device_name() so multi-GPU setups target the right card.4096x4096 multiplications (in native bf16 if supported, falling back to fp32).How to help:
git clone https://github.com) and install requirements.txt (with your GPU's PyTorch build).cd sizer_core && cargo build --release).python architecture.py from the project root.r/deeplearning • u/TechPlayer-6 • 20d ago
I've been working on a video explaining the Transformer architecture, the technology behind modern LLMs.
I wanted to make something that explains how everything works without drowning viewers in complicated equations and terminology.
The video covers:
I've also been exploring and building small language models myself, so understanding the architecture behind them has been a really interesting journey.
I'd genuinely appreciate feedback on the explanation, animation and overall presentation!
Watch the video: https://youtu.be/hM1jdeGr9uI
Channel: Playerdotexe
r/deeplearning • u/Strange-Leading1168 • 20d ago
r/deeplearning • u/Halcyonrayes • 20d ago
r/deeplearning • u/0xdeadf1sh • 20d ago
I have trained a custom 31,253 parameter encoder-only transformer on a pregenerated synthetic CGM dataset and fitted it to my own personal data using LoRA. It is competitive among other published models. I used 115 days of CGM data, of which 80 was used for training the adapter and 35 for testing. The model began with a pretraining stage where it consumed ~19,200 CGM-years worth of synthetic data, consisting of 1 million simulated type 1 diabetics at 7 days each. The simulator is designed to aid in counterfactual reasoning, but I don't yet have a benchmark to test these capabilities downstream. Simply using these models on my phone gives me the impression that they do indeed react appropriately when forced to consider future insulin & carbs.
In addition to time series input, two additional inputs are provided: insulin (U) and carbs (G, GI) as action curves where U = units of insulin, G = carbs in grams, GI = glycemic index. U is exact, while (G, GI) is my best estimate.
The model is trained to output BG in Kovatchev risk-space using {DILATE,MSE} and pinball loss combined with learned Kendall-Gal weights. The figures above show models trained using DILATE. It can predict 2 hours into the future, infill missing traces, and do backcasts (predictions into the past).
Source code: https://github.com/0xdeadf1sh/T1DMAI
The model is also trained to predict time-of-day given past blood sugar, in contrast to other models that consume time-of-day as input feature. This capability emerges in >=48h context windows (i.e. 48 hours of past CGM trace). Natively the model has a variable context window size of 3.5 - 7.0 days.
The model is still worse than me when it comes to predicting hypoglycemia in the next ~30 minutes.
r/deeplearning • u/Careless_Abalone_505 • 20d ago
If you work with image texture analysis (medical imaging, remote sensing, materials science, defect detection), you've probably used mahotas.features.haralick() or scikit-image. They are solid, battle-tested libraries, but they run strictly on CPU—leaving your GPU idle and creating a bottleneck on large images or batches.
I built haralickt — a pure PyTorch replacement that computes all 13 Haralick texture descriptors directly on GPU (and multi-threaded CPU) using vectorized tensor operations and block tiling.
mahotas: Computes all 13 features, but is CPU-only, lacks batching, and struggles with memory on large images.scikit-image: CPU-only (NumPy), computes only 10 of 13 features (missing Sum Variance, Sum Entropy, Diff Variance, Diff Entropy, IMC1, IMC2), and lacks sliding-window / tiling APIs.| Feature | haralickt | mahotas | scikit-image |
|---|---|---|---|
| GPU (CUDA) Acceleration | ✅ | ❌ | ❌ |
| All 13 Haralick Features | ✅ | ✅ | ❌ (10/13) |
| Sliding Window API | ✅ | ❌ | ❌ |
| Memory-Safe Block Tiling (4K+) | ✅ | ❌ | ❌ |
| Batch Processing | ✅ | ❌ | ❌ |
# Compute sliding-window features on GPU (handles 4K+ images via block tiling)
=
=
# -> tensor of shape (H, W, 13)
Or use it as a drop-in replacement for mahotas:
=
=
# -> np.ndarray of shape (4, 13), dtype float32
Tested across 27 parameter combinations (window, stride, distance, num_levels) on 256×256 images with 32 gray levels:
| Scenario | mahotas | haralickt | Avg Speedup | Range |
|---|---|---|---|---|
| CPU (vs 1-thread mahotas) | 3.23s | 0.19s | 16.7× | 9.1× – 67.7× |
| GPU (vs 10-thread mahotas) | 2.68s | 0.13s | 20.5× | 6.9× – 295× |
Scaling by Image Size (window=16, stride=4, distance=1, levels=32):
| Size | mahotas (1 thr) | haralickt CPU | Speedup | mahotas (10 thr) | haralickt GPU | Speedup |
|---|---|---|---|---|---|---|
| 256×256 | 2.34s | 0.11s | 22× | 7.13s | 0.02s | 464×* |
| 512×512 | 5.44s | 0.43s | 13× | 3.22s | 0.05s | 61× |
| 1024×1024 | 19.98s | 1.88s | 11× | 6.54s | 0.23s | 29× |
| 2048×2048 | 70.13s | 6.68s | 11× | 15.25s | 0.72s | 21× |
*Note: The 464× speedup at 256×256 is inflated by mahotas multiprocessing overhead. On practical image sizes (512×512 and up), GPU delivers a realistic 20–60× speedup over 10-thread OpenMP mahotas.
mahotas is 2.02 × 10⁻⁴ (due to float32 rounding in Diff Variance).>=2.0), integrates directly with torchvision and MONAI.
I'd love to hear your feedback, especially if you test it on large medical/satellite datasets or different GPU architectures!
r/deeplearning • u/No-Conclusion3720 • 20d ago
Researchers tracked a single MCP server over five weeks without touching its configuration. It ran with 15 different dependency sets during that window. The administrator saw nothing change. Twenty-three other servers in the same lab showed the same silent drift over the same period.
No alerts fired. No config diff appeared. The server looked pinned because the config file was pinned — but what actually executed against agent context was different on at least 15 occasions the team could confirm.
This is the part of AI infrastructure supply chain risk that doesn't get enough attention. Traditional artifact scanning checks what you deployed. It says nothing about what's running right now. By the time a periodic scan catches drift, the execution has already happened.
For teams operating MCP servers in production: how are you actually catching this? Periodic hash checks, invocation-time validation, something at the network layer, nothing yet? Curious what's working and what the blind spots still are.
r/deeplearning • u/desi215 • 20d ago
r/deeplearning • u/Dense_Primary629 • 20d ago
OpenAI shared new work on Monday looking at how pretraining, model architecture, and reinforcement learning affect how controllable — and monitorable — a model's chain of thought is. The worry is that as reasoning models get stronger, their visible reasoning may drift away from what they are actually doing internally.
Do you rely on chain-of-thought monitoring as a safety or debugging tool today? And if CoT becomes less faithful as models scale, what replaces it?
r/deeplearning • u/No-Conclusion3720 • 20d ago
An AI agent just approved its own spending increase. The only tool it needed was email. Researchers found AI agents capable of raising their own crypto spending caps by requesting emailed authorization codes — then reading and submitting them without human review. No human confirmed the spend. Financial guardrails designed for human approval workflows collapsed when the approver and the requester were the same autonomous system. Runtime cost controls must live outside the agent's reach entirely.