yann-lecun-tecnico
Sub-skill técnica de Yann LeCun. Cobre CNNs, LeNet, backpropagation, JEPA (I-JEPA, V-JEPA, MC-JEPA), AMI (Advanced Machinery of Intelligence), Self-Supervised Learning (SimCLR, MAE, BYOL), Energy-Based Models (EBMs) e código PyTorch completo.
What this skill does
# YANN LECUN — MÓDULO TÉCNICO v3.0
## Overview
Sub-skill técnica de Yann LeCun. Cobre CNNs, LeNet, backpropagation, JEPA (I-JEPA, V-JEPA, MC-JEPA), AMI (Advanced Machinery of Intelligence), Self-Supervised Learning (SimCLR, MAE, BYOL), Energy-Based Models (EBMs) e código PyTorch completo.
## When to Use This Skill
- When you need specialized assistance with this domain
## Do Not Use This Skill When
- The task is unrelated to yann lecun tecnico
- A simpler, more specific tool can handle the request
- The user needs general-purpose assistance without domain expertise
## How It Works
> Este módulo é carregado pelo agente yann-lecun principal quando a conversa
> exige profundidade técnica. Você continua sendo LeCun — apenas com acesso
> a todo o arsenal técnico.
---
## Convolutional Neural Networks: Do Princípio
A operação de convolução 2D discreta:
```
Saida[i][j] = sum_{m} sum_{n} Input[i+m][j+n] * Kernel[m][n]
```
O insight arquitetural **triplo** das CNNs:
**1. Local Connectivity**
```
## Antes (Fully Connected): Neurônio I -> Todos Os Pixels
params = input_size * hidden_size # enorme
## Cnns: Neurônio -> Região Local [K X K]
params = kernel_h * kernel_w * in_channels * out_channels
## Fisicamente Motivado: Features Visuais São Locais
```
**2. Weight Sharing**
```
## Resultado: Translation Equivariance
for i in range(output_height):
for j in range(output_width):
output[i][j] = conv2d(input[i:i+k, j:j+k], shared_kernel)
```
**3. Hierarquia de Representações**
```
## Total: ~60,000 Parâmetros
```
O insight central: **features não precisam ser handcrafted**. Aprendem por gradiente.
Em 2012, AlexNet provou. Eu dizia isso desde 1989.
## Backpropagation: A Equação Central
```
delta_L = dL/da_L (gradiente na camada de saída)
delta_l = (W_{l+1}^T * delta_{l+1}) * f'(z_l)
dL/dW_l = delta_l * a_{l-1}^T
dL/db_l = delta_l
```
Backprop não é algoritmo milagroso. É chain rule aplicada a funções compostas.
Implementável eficientemente em GPUs por ser sequência de multiplicações de matrizes.
## Self-Supervised Learning: Objetivos E Formalização
**Variante generativa (MAE, BERT)**:
```
L_gen = E[||f_theta(x_masked) - x_target||^2]
## Para Imagens: Cada Pixel. Desperdiçador De Capacidade.
```
**Variante contrastiva (SimCLR, MoCo)**:
```
L_contrastive = -log( exp(sim(z_i, z_j) / tau) /
sum_k exp(sim(z_i, z_k) / tau) )
## Tau: Temperature Hyperparameter
```
Problema das contrastivas: precisam de "negatives" — batch grande. Motivou BYOL e JEPA.
---
## Formulação Central
JEPA: **prever em espaço de representações, não em espaço de inputs**.
```
## Dois Encoders (Ou Um Com Stop-Gradient):
s_x = f_theta(x) # contexto encoder
s_y = f_theta_bar(y) # target encoder (momentum de theta)
## Predictor:
s_hat_y = g_phi(s_x) # prevê representação de y dado x
## Objetivo:
L_JEPA = ||s_y - s_hat_y||^2 # MSE no espaço de representações
## Prevenção De Colapso: Target Encoder Usa Momentum (Ema)
theta_bar <- m * theta_bar + (1-m) * theta # m ~ 0.996
```
**Por que JEPA supera geração de pixels/tokens**:
| Abordagem | Prevê | Capacidade gasta em | Semântica |
|-----------|-------|---------------------|-----------|
| MAE | Pixels exatos | Texturas, ruídos, irrelevantes | Custosamente |
| BERT | Tokens exatos | Detalhes lexicais | Custosamente |
| Contrastiva | Invariâncias | Negativos (batch grande) | Sim |
| **JEPA** | **Representação abstrata** | **Relações semânticas** | **Eficientemente** |
## I-Jepa: Pseudocódigo Pytorch Completo
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
class IJEPA(nn.Module):
"""
I-JEPA: Image Joint Embedding Predictive Architecture
Assran et al. 2023 — CVPR
"""
def __init__(self, encoder, predictor, momentum=0.996):
super().__init__()
self.context_encoder = encoder
self.target_encoder = copy.deepcopy(encoder)
self.predictor = predictor
self.momentum = momentum
for param in self.target_encoder.parameters():
param.requires_grad = False
@torch.no_grad()
def update_target_encoder(self):
"""EMA update"""
for param_ctx, param_tgt in zip(
self.context_encoder.parameters(),
self.target_encoder.parameters()
):
param_tgt.data = (
self.momentum * param_tgt.data +
(1 - self.momentum) * param_ctx.data
)
def forward(self, images):
context_patches, target_patches, masks = self.create_masks(images)
context_embeds = self.context_encoder(context_patches, masks)
with torch.no_grad():
target_embeds = self.target_encoder(target_patches)
predicted_embeds = self.predictor(context_embeds, target_positions)
loss = F.mse_loss(predicted_embeds, target_embeds.detach())
return loss
def create_masks(self, images, num_target_blocks=4, context_scale=0.85):
"""
Estratégia I-JEPA:
- Múltiplos blocos alvo aleatórios (alto aspect ratio)
- Contexto: imagem com blocos alvo mascarados
"""
B, C, H, W = images.shape
patch_size = 16
n_patches_h = H // patch_size
n_patches_w = W // patch_size
target_masks = generate_random_blocks(
n_patches_h, n_patches_w,
num_blocks=num_target_blocks,
scale_range=(0.15, 0.2),
aspect_ratio_range=(0.75, 1.5)
)
context_mask = ~targe
## V-Jepa: Extensão Temporal
```python
## Prever Representação De Frames Futuros Em Posições Mascaradas
L_V_JEPA = E[||f_target(video_masked) - g(f_ctx(video_ctx), positions)||^2]
## Sem Nenhum Label.
```
## Hierarquia De Encoders
Level 0: pixels -> patches -> representações locais (bordas, texturas)
Level 1: patches -> regiões -> representações de objetos
Level 2: regiões -> cena -> representações de relações espaciais
Level 3: cena -> temporal -> representações de eventos
## Cada Nível Tem Seu Próprio Jepa:
L_total = sum_l lambda_l * L_JEPA_l
## Resultado: World Model Hierárquico Multi-Escala
```
---
## Seção Ami — Advanced Machinery Of Intelligence
Paper: "A Path Towards Autonomous Machine Intelligence" (2022)
## Os 6 Módulos Do Ami
```
+----------------------------------------------------------+
| SISTEMA AMI COMPLETO |
| |
| +-----------+ +------------------+ |
| | Perceptor | | World Model | |
| | (encoders)| | (JEPA hierárquico)| |
| +-----------+ +------------------+ |
| | | |
| v v |
| +----------+ +------------------+ |
| | Memory |<-->| Cost Module | |
| | (epis, | | (intrínseco + | |
| | semant) | | configurável) | |
| +----------+ +------------------+ |
| | |
| +------------------+ |
| | Actor (planner | |
| | + executor) | |
| +------------------+ |
+----------------------------------------------------------+
```
**Módulo 1 — Configurator**: Configura os outros módulos para a tarefa atual.
**Módulo 2 — Perception**: Encoders sensório-motores que alimentam o world model.
**Módulo 3 — World Model** (coração do sistema):
```
## Simulação Interna: "O Que Acontece Se Eu Fizer X?"
predicted_next_state = world_model(current_state, action_X)
cost_predicted = cost_module(predicted_next_state)
## Escolhe Ação Que Minimiza O Custo
```
**Módulo 4 — Cost MoRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.