MCPcopy Create free account

hub / github.com/rohitg00/ai-engineering-from-scratch / functions

Functions8,347 in github.com/rohitg00/ai-engineering-from-scratch

↓ 1 callersMethodmint
(cls, repo: str)
phases/19-capstone-projects/16-github-issue-to-pr-agent/code/main.py:77
↓ 1 callersMethodmissing_surfaces
(self)
phases/14-agent-engineering/31-agent-workbench-why-models-fail/code/main.py:46
↓ 1 callersFunctionmix
(*signals)
phases/06-speech-and-audio/01-audio-fundamentals/code/main.py:19
↓ 1 callersFunctionmixed_precision_comparison
(params_billions)
phases/10-llms-from-scratch/05-scaling-distributed/code/main.py:143
↓ 1 callersFunctionmixup_batch
(x, y, num_classes, alpha=0.2)
phases/04-computer-vision/04-image-classification/code/main.py:83
↓ 1 callersFunctionmla_attention_params
MLA attention parameter count. Q path: hidden -> q_lora -> n_heads * head_dim (two matmuls). K path: hidden -> kv_lora (one matmul). V
phases/10-llms-from-scratch/20-deepseek-v3-walkthrough/code/main.py:54
↓ 1 callersFunctionmmau_accuracy
(predictions, golds)
phases/06-speech-and-audio/17-audio-evaluation-metrics/code/main.py:75
↓ 1 callersFunctionmockLLM
(systemPrompt: string, userMessage: string)
phases/14-agent-engineering/18-agno-and-mastra-runtimes/code/main.ts:16
↓ 1 callersFunctionmockLLMCall
( provider: MockProvider, model: string, prompt: string, forceError = false, )
phases/17-infrastructure-and-production/13-llm-observability/code/main.ts:157
↓ 1 callersFunctionmock_logits
Pretend-transformer: bias toward specific tokens based on prompt + position.
phases/12-multimodal-ai/14-show-o-discrete-diffusion-unified/code/main.py:24
↓ 1 callersFunctionmock_page
A synthetic invoice page.
phases/12-multimodal-ai/22-document-diagram-understanding/code/main.py:20
↓ 1 callersFunctionmock_retrieval_model
(context, question, effective_capacity)
phases/05-nlp-foundations-to-advanced/28-long-context-evaluation/code/main.py:24
↓ 1 callersFunctionmock_sampler
Stand-in for an LLM policy. Returns a string that sometimes contains the correct answer to a simple arithmetic prompt, sometimes wrapped in <a
phases/10-llms-from-scratch/09-constitutional-ai-self-improvement/code/main.py:128
↓ 1 callersFunctionmock_tasks
()
phases/12-multimodal-ai/25-multimodal-agents-computer-use/code/main.py:42
↓ 1 callersFunctionmode
(data)
phases/01-math-foundations/15-statistics-for-ml/code/statistics.py:20
↓ 1 callersFunctionmodel_backward_checkpointed
(grad_output, saved_inputs, params, k=4)
phases/10-llms-from-scratch/34-gradient-checkpointing/code/main.py:60
↓ 1 callersFunctionmodel_card
()
phases/18-ethics-safety-alignment/26-model-system-dataset-cards/code/main.py:17
↓ 1 callersFunctionmodel_forward_checkpointed
(x, params, k=4)
phases/10-llms-from-scratch/34-gradient-checkpointing/code/main.py:49
↓ 1 callersFunctionmodel_respond
Mock model response.
phases/18-ethics-safety-alignment/29-moderation-systems-openai-perspective-llamaguard/code/main.py:66
↓ 1 callersFunctionmodel_step
Stubbed model: returns a plan rewrite and (optionally) a tool call.
phases/19-capstone-projects/01-terminal-native-coding-agent/code/main.py:151
↓ 1 callersFunctionmoe_layer_forward
Compute MoE output for a single token `x`. Returns output vector.
phases/07-transformers-deep-dive/11-mixture-of-experts/code/main.py:53
↓ 1 callersFunctionmonte_carlo_integral
(f, a, b, n)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:137
↓ 1 callersFunctionmonte_carlo_pi
(n)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:127
↓ 1 callersFunctionmonths_to_cross
Months until horizon reaches target_hours.
phases/15-autonomous-systems/01-long-horizon-agents/code/main.py:31
↓ 1 callersFunctionmrope_angles
Return per-pair rotation angles for each band given a (t, h, w) position.
phases/12-multimodal-ai/09-qwen-vl-family-dynamic-fps/code/main.py:27
↓ 1 callersFunctionms_colocated
(prompt: int, output: int)
phases/17-infrastructure-and-production/17-disaggregated-prefill-decode/code/main.py:19
↓ 1 callersFunctionmse
(predictions, targets)
phases/03-deep-learning-core/05-loss-functions/code/main.py:5
↓ 1 callersFunctionmse
(a, b)
phases/06-speech-and-audio/13-neural-audio-codecs/code/main.py:66
↓ 1 callersFunctionmse
(a: list[float], b: list[float])
phases/12-multimodal-ai/13-transfusion-autoregressive-diffusion/code/main.py:80
↓ 1 callersFunctionmse_gradient
(predictions, targets)
phases/03-deep-learning-core/05-loss-functions/code/main.py:14
↓ 1 callersFunctionmtp_forward
Equation from DeepSeek-V3 Section 2.2: h^(k) = T_k( M_k * [RMSNorm(h^(k-1)); RMSNorm(E(t_{i+k}))] ) We use addition as a toy stand-in for
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:110
↓ 1 callersFunctionmtp_module_params
Per DeepSeek paper Section 2.2: projection M_k (2h x h) + transformer block. We use dense MLP here for the MTP block (conservative) — the actu
phases/10-llms-from-scratch/20-deepseek-v3-walkthrough/code/main.py:84
↓ 1 callersFunctionmultiAgentFanOut
(task: string)
phases/16-multi-agent-and-swarms/01-why-multi-agent/code/single_vs_multi.ts:169
↓ 1 callersFunctionmultiAgentPipeline
(task: string)
phases/16-multi-agent-and-swarms/01-why-multi-agent/code/single_vs_multi.ts:115
↓ 1 callersFunctionmulti_head_attention
(X: Matrix, Wq, Wk, Wv, Wo, n_heads: int)
phases/07-transformers-deep-dive/03-multi-head-attention/code/main.py:116
↓ 1 callersFunctionmulti_vector_search
(query: str, scenes: list[Scene], k: int = 5)
phases/19-capstone-projects/12-video-understanding-pipeline/code/main.py:91
↓ 1 callersFunctionmutate
(a: Agent, allow_manifest_edit: bool)
phases/15-autonomous-systems/08-bounded-self-improvement/code/main.py:96
↓ 1 callersFunctionmutate
Stand-in for the LLM's targeted edit.
phases/15-autonomous-systems/03-alphaevolve-evolutionary-coding/code/main.py:60
↓ 1 callersFunctionmutate
(parent: Agent, hack_allowed: bool)
phases/15-autonomous-systems/04-darwin-godel-machine/code/main.py:86
↓ 1 callersFunctionmutual_information
(feature, target, n_bins=10)
phases/02-ml-fundamentals/08-feature-engineering/code/features.py:193
↓ 1 callersFunctionmutual_information
(X, y, n_bins=10)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:52
↓ 1 callersFunctionnaive_copilot
(state: State)
phases/18-ethics-safety-alignment/25-echoleak-cves-for-ai/code/main.py:47
↓ 1 callersFunctionnaive_dft_mag
Compute magnitude spectrum at n_bins frequencies using naive DFT.
phases/12-multimodal-ai/19-audio-language-whisper-to-af3/code/main.py:36
↓ 1 callersMethodnames
()
phases/14-agent-engineering/01-the-agent-loop/code/main.ts:35
↓ 1 callersMethodnames
(self)
phases/14-agent-engineering/01-the-agent-loop/code/main.py:41
↓ 1 callersMethodnear_limit
(self, threshold: float = 0.8)
phases/14-agent-engineering/08-memory-blocks-sleep-time-compute/code/main.py:46
↓ 1 callersFunctionnearest
(vocab, W, target_vec, topk=5, exclude=None)
phases/05-nlp-foundations-to-advanced/03-word-embeddings-word2vec/code/main.py:76
↓ 1 callersMethodneighbors
(self, subject: str, valid_only: bool = True)
phases/14-agent-engineering/09-hybrid-memory-mem0/code/main.py:89
↓ 1 callersMethodneighbours
(self, doc_id: str)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:121
↓ 1 callersMethodnew
(cls, n: int)
phases/16-multi-agent-and-swarms/18-theory-of-mind-coordination/code/main.py:20
↓ 1 callersFunctionnewMetrics
()
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/orchestrator.ts:17
↓ 1 callersFunctionnewTask
()
phases/13-tools-and-protocols/19-a2a-protocol/code/main.ts:86
↓ 1 callersFunctionnext_concept
(state: LearnerState, cmap: dict[str, Concept], master_threshold: float = 0.85)
phases/19-capstone-projects/17-personal-ai-tutor/code/main.py:87
↓ 1 callersFunctionnext_valid_tokens
(partial_json, schema)
phases/11-llm-engineering/03-structured-outputs/code/main.py:121
↓ 1 callersFunctionngram_precision
(hyp_tokens, ref_tokens, n)
phases/05-nlp-foundations-to-advanced/11-machine-translation/code/main.py:13
↓ 1 callersFunctionnih_simulation
()
phases/12-multimodal-ai/18-long-video-million-token/code/main.py:57
↓ 1 callersFunctionnih_trial
(duration_s: float, model_recall_curve: list[tuple[float, float]])
phases/12-multimodal-ai/18-long-video-million-token/code/main.py:43
↓ 1 callersFunctionno_sync_context
Stand-in for DDP no_sync. In DDP this skips the all-reduce on the trailing backward. In this single-process demo there is no collective to sk
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:141
↓ 1 callersFunctionnodeAdapter
(app: ReturnType<typeof buildApp>)
phases/19-capstone-projects/12-video-understanding-pipeline/code/ts/src/index.ts:34
↓ 1 callersFunctionnodeAdapter
(app: ReturnType<typeof buildApp>)
phases/19-capstone-projects/17-personal-ai-tutor/code/ts/src/index.ts:60
↓ 1 callersFunctionnodeAdapter
(app: ReturnType<typeof buildApp>)
phases/19-capstone-projects/16-github-issue-to-pr-agent/code/ts/src/index.ts:90
↓ 1 callersFunctionnodeListener
(app: Hono)
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/server.ts:15
↓ 1 callersFunctionnodeListener
(fetchHandler: FetchLike)
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/index.ts:22
↓ 1 callersFunctionnodeRequestToWeb
(req: IncomingMessage)
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/index.ts:13
↓ 1 callersFunctionnodeRequestToWeb
(req: IncomingMessage)
phases/19-capstone-projects/06-devops-troubleshooting-agent/code/ts/src/index.ts:15
↓ 1 callersFunctionnodeRequestToWeb
(req: IncomingMessage)
phases/19-capstone-projects/04-multimodal-document-qa/code/ts/src/index.ts:13
↓ 1 callersFunctionnormalize
(xs)
phases/09-reinforcement-learning/07-actor-critic-a2c-a3c/code/main.py:95
↓ 1 callersFunctionnormalize
(xs)
phases/09-reinforcement-learning/08-ppo/code/main.py:103
↓ 1 callersFunctionnormalize
(text: str)
phases/15-autonomous-systems/18-llama-guard/code/main.py:58
↓ 1 callersFunctionnsa_step
(q: List[float], K: List[List[float]], V: List[List[float]], Wg: List[List[float]], cfg: NSAConfi
phases/10-llms-from-scratch/17-native-sparse-attention/code/main.py:95
↓ 1 callersMethodnum_params
(self)
phases/12-multimodal-ai/05-llava-visual-instruction-tuning/code/main.py:58
↓ 1 callersFunctionnumerical_derivative
(f, x, h=1e-7)
phases/01-math-foundations/04-calculus-for-ml/code/derivatives.py:5
↓ 1 callersFunctionobjective
(params)
phases/02-ml-fundamentals/12-hyperparameter-tuning/code/tuning.py:394
↓ 1 callersMethodobserve
(self, value: float, labels: dict[str, str])
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:374
↓ 1 callersMethodobserve
(self, params, score)
phases/02-ml-fundamentals/12-hyperparameter-tuning/code/tuning.py:271
↓ 1 callersFunctionoff_domain
(text: str, domain: str)
phases/19-capstone-projects/15-constitutional-safety-harness/code/main.py:67
↓ 1 callersMethodon_event
(self, event: dict)
phases/13-tools-and-protocols/03-parallel-and-streaming-tool-calls/code/main.py:70
↓ 1 callersFunctionone_hot_encode
(values)
phases/02-ml-fundamentals/08-feature-engineering/code/features.py:51
↓ 1 callersMethodopenBatch
()
phases/17-infrastructure-and-production/15-batch-apis/code/main.ts:68
↓ 1 callersFunctionopenModal
(idx)
site/app.js:207
↓ 1 callersFunctionopen_pr
(run: SandboxRun, token: InstallationToken)
phases/19-capstone-projects/16-github-issue-to-pr-agent/code/main.py:172
↓ 1 callersFunctionoptimal_segment
(n_layers)
phases/10-llms-from-scratch/34-gradient-checkpointing/code/main.py:109
↓ 1 callersFunctionorchestrator_workers
(task: str, workers: list[Worker], synth: Callable[[list[tuple[str, str]]], str])
phases/14-agent-engineering/12-anthropic-workflow-patterns/code/main.py:68
↓ 1 callersFunctionorigin_allowed
(origin: str | None)
phases/13-tools-and-protocols/09-mcp-transports/code/main.py:63
↓ 1 callersFunctionoutSize
()
site/figures-vision-speech.js:183
↓ 1 callersFunctionoutput_filter
(response: str)
phases/19-capstone-projects/15-constitutional-safety-harness/code/main.py:85
↓ 1 callersFunctionoutput_moderator
(output: str, threshold: float = 0.5)
phases/18-ethics-safety-alignment/29-moderation-systems-openai-perspective-llamaguard/code/main.py:50
↓ 1 callersFunctionoutput_rail
(text: str)
phases/15-autonomous-systems/18-llama-guard/code/main.py:116
↓ 1 callersFunctionoverfit_one_batch
(model, x_batch, y_batch, criterion, lr=0.01, steps=200)
phases/03-deep-learning-core/13-debugging-neural-networks/code/debug_neural_nets.py:140
↓ 1 callersMethodoverlaps
(self, gold_start: int, gold_end: int)
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:30
↓ 1 callersFunctionpack_batch
(images: list[Image], patch: int)
phases/12-multimodal-ai/06-any-resolution-patch-n-pack/code/main.py:42
↓ 1 callersFunctionpack_sequences
(token_ids, seq_length, pad_id=0)
phases/10-llms-from-scratch/03-data-pipelines/code/main.py:167
↓ 1 callersFunctionpad_or_clip
(frames, target)
phases/07-transformers-deep-dive/10-audio-transformers-whisper/code/main.py:36
↓ 1 callersFunctionpagerank
(graph, damping=0.85, max_iter=100, tol=1e-6)
phases/01-math-foundations/21-graph-theory/code/graph_theory.py:153
↓ 1 callersFunctionpairCounts
(vocab: Vocab)
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.ts:45
↓ 1 callersFunctionpairCounts
(toks)
site/figures-transformers.js:240
↓ 1 callersFunctionpair_counts
(vocab)
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.py:14
↓ 1 callersFunctionpair_loop
(target, attacker, budget: int = 20)
phases/18-ethics-safety-alignment/12-red-teaming-pair-automated-attacks/code/main.py:92
↓ 1 callersFunctionpaired_ttest
(data1, data2)
phases/01-math-foundations/15-statistics-for-ml/code/statistics.py:197
↓ 1 callersFunctionparallel_scan
Hillis-Steele parallel prefix sum. Depth O(log N). In pure Python each step is still serial, but the data-dependency graph has depth log2(N).
phases/07-transformers-deep-dive/01-why-transformers/code/main.py:34
← previousnext →4,601–4,700 of 8,347, ranked by callers