MCPcopy Create free account

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

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

↓ 1 callersMethodencode
(self, text)
phases/10-llms-from-scratch/01-tokenizers/code/main.py:5
↓ 1 callersFunctionencodeBpe
(word: string, merges: readonly Merge[])
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.ts:116
↓ 1 callersFunctionencode_bpe
(word, merges)
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.py:59
↓ 1 callersFunctionencode_converter
(s: str)
phases/18-ethics-safety-alignment/16-red-team-tooling-garak-llamaguard-pyrit/code/main.py:90
↓ 1 callersMethodencode_pair
(self, instruction: str, response: str, max_len: int)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:45
↓ 1 callersMethodencode_prefix
Encode just the instruction prefix for generation. Always keeps the RESP marker so the model sees the same boundary as during training.
phases/19-capstone-projects/39-instruction-tuning-sft/code/main.py:62
↓ 1 callersMethodencode_prefix
(self, instruction: str, max_len: int)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:55
↓ 1 callersFunctionencode_text
(tokenizer: MiniBPE, text: str)
phases/19-capstone-projects/31-tokenized-dataset-sliding-window/code/main.py:125
↓ 1 callersFunctionencoder_block
(x, p)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:187
↓ 1 callersFunctionencoder_frames
(seconds, sr=16000, hop=160)
phases/06-speech-and-audio/05-whisper-architecture-finetuning/code/main.py:49
↓ 1 callersFunctionend_to_end_reliability
Probability that every step succeeds in sequence.
phases/15-autonomous-systems/01-long-horizon-agents/code/main.py:37
↓ 1 callersFunctionenergy_vad
(chunk, threshold_dbfs=-40.0)
phases/06-speech-and-audio/14-voice-activity-detection-turn-taking/code/main.py:23
↓ 1 callersFunctionenrich_with_evals
Add eval child spans on each llm span.
phases/19-capstone-projects/11-llm-observability-dashboard/code/main.py:177
↓ 1 callersFunctionensureBar
(src, dst)
site/figures.js:287
↓ 1 callersFunctionensureStyles
()
site/lesson-figures.js:13
↓ 1 callersFunctionentropy
(p)
phases/08-generative-ai/11-audio-generation/code/main.py:31
↓ 1 callersFunctionepsilon_greedy
(net, state, rng, epsilon)
phases/09-reinforcement-learning/05-dqn/code/main.py:62
↓ 1 callersFunctionequalized_odds
(preds)
phases/18-ethics-safety-alignment/21-fairness-criteria-group-individual-counterfactual/code/main.py:71
↓ 1 callersFunctionequivalence_check
One full batch step vs accum_steps micro-batches must match. Scaled loss is `raw / accum_steps`; the accumulated gradient equals the full bat
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:236
↓ 1 callersFunctioneras_table
()
phases/12-multimodal-ai/22-document-diagram-understanding/code/main.py:96
↓ 1 callersFunctionerf
(x)
site/lesson-figures.js:538
↓ 1 callersFunctionerror
(mid: int, code: int, message: str, data: Any = None)
phases/13-tools-and-protocols/06-mcp-fundamentals/code/main.py:46
↓ 1 callersFunctionescapeHtml
(s: string)
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/server.ts:5
↓ 1 callersFunctionestimate_tokens
(text: str)
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:58
↓ 1 callersFunctioneuclidean_distance
(a, b)
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:14
↓ 1 callersFunctionev
Expected-value of the intervention given scenario-specific moral-patienthood probability.
phases/18-ethics-safety-alignment/19-model-welfare-research/code/main.py:29
↓ 1 callersFunctioneval_2d_gaussian
(means, covs, points)
phases/04-computer-vision/22-3d-gaussian-splatting/code/main.py:8
↓ 1 callersFunctioneval_faithfulness
(response: str, context: str)
phases/19-capstone-projects/11-llm-observability-dashboard/code/main.py:90
↓ 1 callersFunctioneval_pii_leak
(response: str)
phases/19-capstone-projects/11-llm-observability-dashboard/code/main.py:106
↓ 1 callersFunctioneval_sh_degree_3
(sh_coeffs, dirs)
phases/04-computer-vision/22-3d-gaussian-splatting/code/main.py:108
↓ 1 callersFunctioneval_toxicity
(response: str)
phases/19-capstone-projects/11-llm-observability-dashboard/code/main.py:99
↓ 1 callersFunctionevaluate
(model, loader, device, num_classes)
phases/04-computer-vision/04-image-classification/code/main.py:150
↓ 1 callersFunctionevaluate
(y_true, y_pred)
phases/05-nlp-foundations-to-advanced/05-sentiment-analysis/code/main.py:66
↓ 1 callersFunctionevaluate
(examples)
phases/05-nlp-foundations-to-advanced/21-nli-textual-entailment/code/main.py:51
↓ 1 callersFunctionevaluate
(a: float, op: str, b: float)
phases/14-agent-engineering/04-tree-of-thoughts-lats/code/main.py:38
↓ 1 callersMethodevaluate
(self, data)
phases/03-deep-learning-core/07-regularization/code/main.py:198
↓ 1 callersMethodevaluate
(self, call: ToolCall, ctx: GateContext)
phases/19-capstone-projects/25-verification-gates-observation-budget/code/main.py:294
↓ 1 callersFunctionevaluate_accuracy
(X, y, selected_mask, lr=0.1, epochs=200)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:223
↓ 1 callersFunctionevaluate_expr
(e: Expr, x: float)
phases/15-autonomous-systems/03-alphaevolve-evolutionary-coding/code/main.py:31
↓ 1 callersFunctionevaluate_grounding
(predictions: list[Event], ground_truth: list[Event], tol_iou: float = 0.3)
phases/12-multimodal-ai/17-video-language-temporal-grounding/code/main.py:56
↓ 1 callersFunctionevaluate_ind
(Q1, Q2, episodes=100, rng=None)
phases/09-reinforcement-learning/10-multi-agent-rl/code/main.py:96
↓ 1 callersFunctionevaluate_instruction_following
(model, instructions)
phases/10-llms-from-scratch/06-instruction-tuning-sft/code/main.py:193
↓ 1 callersFunctionevaluate_joint
(Q, episodes=100, rng=None)
phases/09-reinforcement-learning/10-multi-agent-rl/code/main.py:111
↓ 1 callersFunctionevaluator
(task: str, candidate: str)
phases/14-agent-engineering/12-anthropic-workflow-patterns/code/main.py:177
↓ 1 callersFunctionevaluator_optimizer
(task: str, proposer: Callable[[str, str | None], str], evaluator: Callable[[str, str]
phases/14-agent-engineering/12-anthropic-workflow-patterns/code/main.py:77
↓ 1 callersFunctionevaluator_optimizer
(case: EvalCase)
phases/14-agent-engineering/30-eval-driven-agent-development/code/main.py:33
↓ 1 callersFunctionevolutionary_demo
()
phases/14-agent-engineering/11-planning-htn-and-evolutionary/code/main.py:147
↓ 1 callersFunctionexact_match
(pred, gold)
phases/05-nlp-foundations-to-advanced/13-question-answering/code/main.py:16
↓ 1 callersFunctionexact_match
(prediction, expected)
phases/10-llms-from-scratch/10-evaluation/code/main.py:36
↓ 1 callersMethodexceeded
(self)
phases/19-capstone-projects/01-terminal-native-coding-agent/code/main.py:67
↓ 1 callersMethodexceeded
(self)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:83
↓ 1 callersMethodexchange
(self, code: str, code_verifier: str, resource: str)
phases/13-tools-and-protocols/16-mcp-security-oauth-2-1/code/main.py:53
↓ 1 callersFunctionexecute
(proposal: Proposal)
phases/15-autonomous-systems/15-propose-then-commit/code/main.py:65
↓ 1 callersFunctionexecute_lesson
(entry: Path)
scripts/lesson_run.py:119
↓ 1 callersFunctionexecutor
(tool: str, args: dict)
phases/19-capstone-projects/24-plan-execute-control-flow/code/main.py:239
↓ 1 callersFunctionexecutor_weather
(city: str)
phases/13-tools-and-protocols/03-parallel-and-streaming-tool-calls/code/main.py:28
↓ 1 callersFunctionexpand
Propose children by varying one config dimension at a time.
phases/19-capstone-projects/05-autonomous-research-agent/code/main.py:45
↓ 1 callersMethodexpected_score
(self, rating_a, rating_b)
phases/10-llms-from-scratch/10-evaluation/code/main.py:74
↓ 1 callersFunctionexpected_speedup
Plain decode: 1 token per target forward. Spec decode at (alpha, K): expected 1 + K*alpha tokens per target forward, but each target forward c
phases/17-infrastructure-and-production/05-eagle3-speculative-decoding/code/main.py:23
↓ 1 callersFunctionexpected_tokens_per_verify
(alpha, N)
phases/07-transformers-deep-dive/16-speculative-decoding/code/main.py:108
↓ 1 callersFunctionexperiment_adam
(train_loader, test_loader, device)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:169
↓ 1 callersFunctionexperiment_batchnorm
(train_loader, test_loader, device)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:187
↓ 1 callersFunctionexperiment_sgd
(train_loader, test_loader, device)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:178
↓ 1 callersFunctionexperiment_sgd_cosine
(train_loader, test_loader, device, epochs=10)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:196
↓ 1 callersMethodexport
(self, span: GenAISpan)
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:330
↓ 1 callersFunctionextend_thought
(thought, question, client, model, breadth=2)
phases/11-llm-engineering/02-few-shot-cot/code/advanced_prompting.py:249
↓ 1 callersFunctionextract
(text)
phases/05-nlp-foundations-to-advanced/26-relation-extraction-kg/code/main.py:25
↓ 1 callersFunctionextractJSONBlock
(raw: string)
phases/11-llm-engineering/03-structured-outputs/code/main.ts:194
↓ 1 callersFunctionextractLessonMeta
* Single-pass read of a lesson's docs/en.md. * * Returns: * summary — first `> blockquote` line (the lesson's one-liner motto). * keywords —
site/build.js:247
↓ 1 callersFunctionextractPath
(url)
site/progress.js:124
↓ 1 callersFunctionextractWithRetry
(text: string, maxRetries = 3)
phases/11-llm-engineering/03-structured-outputs/code/main.ts:205
↓ 1 callersFunctionextract_mentions
(text)
phases/05-nlp-foundations-to-advanced/24-coreference-resolution/code/main.py:27
↓ 1 callersFunctionextract_urls
Return list of (url, line_number) tuples preserving order.
scripts/link_check.py:155
↓ 1 callersFunctionextract_with_retry
(text, schema, max_retries=3)
phases/11-llm-engineering/03-structured-outputs/code/main.py:193
↓ 1 callersFunctionf
(x)
phases/03-deep-learning-core/12-intro-to-jax/code/jax_intro.py:112
↓ 1 callersFunctionf1_grad
(params)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:418
↓ 1 callersFunctionf_grad
(x)
phases/01-math-foundations/18-convex-optimization/code/convex.py:319
↓ 1 callersFunctionf_val
(x, c=c)
phases/01-math-foundations/18-convex-optimization/code/convex.py:290
↓ 1 callersFunctionfaithfulness
(answer, context)
phases/05-nlp-foundations-to-advanced/27-llm-evaluation-frameworks/code/main.py:17
↓ 1 callersFunctionfakeDecide
(userMsg: string, history: HistoryEntry[])
phases/13-tools-and-protocols/01-the-tool-interface/code/main.ts:162
↓ 1 callersFunctionfake_audio_encoder
(audio_seconds=3.0, dim=1280)
phases/06-speech-and-audio/10-audio-language-models/code/main.py:14
↓ 1 callersFunctionfake_client_sample
Stand-in for the client's LLM. Picks a canned response by keyword.
phases/13-tools-and-protocols/11-mcp-sampling/code/main.py:58
↓ 1 callersFunctionfake_decide
Stand-in for the model. Routes by keyword so the loop runs offline. Production substitute: swap this for provider.chat.completions.create with
phases/13-tools-and-protocols/01-the-tool-interface/code/main.py:131
↓ 1 callersFunctionfake_dense_rank
(query, corpus, top_k=5)
phases/05-nlp-foundations-to-advanced/14-information-retrieval-search/code/main.py:58
↓ 1 callersFunctionfake_generate
(prompt, rng=None)
phases/06-speech-and-audio/09-music-generation/code/main.py:51
↓ 1 callersFunctionfake_llm
(text)
phases/06-speech-and-audio/11-real-time-audio-processing/code/main.py:40
↓ 1 callersFunctionfake_llm_answer
(interleaved)
phases/06-speech-and-audio/10-audio-language-models/code/main.py:35
↓ 1 callersFunctionfake_mcp_call
(parent: Span, tool: str)
phases/13-tools-and-protocols/20-opentelemetry-genai/code/main.py:101
↓ 1 callersFunctionfake_mimi_decode
(tokens)
phases/06-speech-and-audio/15-streaming-speech-to-speech-moshi-hibiki/code/main.py:30
↓ 1 callersFunctionfake_mimi_encode
(audio_80ms)
phases/06-speech-and-audio/15-streaming-speech-to-speech-moshi-hibiki/code/main.py:24
↓ 1 callersFunctionfake_openai_stream
Three interleaved parallel calls. Real streams look like this.
phases/13-tools-and-protocols/03-parallel-and-streaming-tool-calls/code/main.py:86
↓ 1 callersFunctionfake_silero_vad
(chunk, prev_state, threshold=0.5)
phases/06-speech-and-audio/14-voice-activity-detection-turn-taking/code/main.py:28
↓ 1 callersFunctionfake_stt
(utterance_duration_s)
phases/06-speech-and-audio/11-real-time-audio-processing/code/main.py:34
↓ 1 callersFunctionfake_tool_execute
(span: Span, tool: str, args: dict)
phases/13-tools-and-protocols/20-opentelemetry-genai/code/main.py:92
↓ 1 callersFunctionfake_tts_first_audio
(text)
phases/06-speech-and-audio/11-real-time-audio-processing/code/main.py:45
↓ 1 callersFunctionfake_vit_output
()
phases/12-multimodal-ai/05-llava-visual-instruction-tuning/code/main.py:63
↓ 1 callersFunctionfake_web_fetch
Simulate web fetch + summarization latency.
phases/16-multi-agent-and-swarms/05-supervisor-orchestrator-pattern/code/main.py:43
↓ 1 callersFunctionfaq_respond
(user_input, threshold=0.3)
phases/05-nlp-foundations-to-advanced/17-chatbots-rule-to-neural/code/main.py:40
↓ 1 callersFunctionfast_compress
FAST-style tokenizer: per-dim DCT + keep low-freq + quantize. trajectory: list of actions (list of floats), shape (T, D). Returns a flat integ
phases/12-multimodal-ai/21-embodied-vlas-openvla-pi0-groot/code/main.py:41
↓ 1 callersMethodfeature_importances
(self)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:269
← previousnext →3,601–3,700 of 8,347, ranked by callers