MCPcopy Create free account

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

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

↓ 2 callersFunctiontemperature_sample
(logits, temperature)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:226
↓ 2 callersFunctiontickAll
(migrations: Migration[], rng: () => number = Math.random)
phases/19-capstone-projects/09-code-migration-agent/code/ts/src/migrations.ts:121
↓ 2 callersFunctiontickOne
(m: Migration, rng: () => number = Math.random)
phases/19-capstone-projects/09-code-migration-agent/code/ts/src/migrations.ts:100
↓ 2 callersFunctiontnode
(t)
site/figures-vision-speech.js:76
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/52-experiment-runner/code/main.py:284
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:34
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/28-observability-otel-traces/code/main.py:68
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:295
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:157
↓ 2 callersMethodto_dict
(self)
phases/19-capstone-projects/55-critic-loop/code/main.py:74
↓ 2 callersMethodto_json
(self)
phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py:86
↓ 2 callersMethodto_json
(self)
phases/19-capstone-projects/80-checkpoint-sharded-resume/code/main.py:48
↓ 2 callersFunctionto_polar
(z)
phases/01-math-foundations/19-complex-numbers/code/complex_numbers.py:71
↓ 2 callersFunctiontoken_f1_eval
( model: TinyGPT, tok: InstructionTokenizer, pairs: Sequence[Tuple[str, str]], )
phases/19-capstone-projects/41-eval-pipeline/code/main.py:528
↓ 2 callersFunctiontoken_set
(text)
phases/05-nlp-foundations-to-advanced/17-chatbots-rule-to-neural/code/main.py:36
↓ 2 callersFunctiontokenize
(text)
phases/05-nlp-foundations-to-advanced/11-machine-translation/code/main.py:5
↓ 2 callersFunctiontokenize
(text)
phases/05-nlp-foundations-to-advanced/22-embedding-models-deep-dive/code/main.py:7
↓ 2 callersFunctiontokenize
(text)
phases/05-nlp-foundations-to-advanced/25-entity-linking/code/main.py:39
↓ 2 callersFunctiontokenize
(text)
phases/05-nlp-foundations-to-advanced/21-nli-textual-entailment/code/main.py:12
↓ 2 callersFunctiontokenize
(text: str)
phases/19-capstone-projects/04-multimodal-document-qa/code/main.py:27
↓ 2 callersFunctiontokenizeAll
(words)
site/figures-transformers.js:239
↓ 2 callersFunctiontokenize_instruction_pair
(instruction, response, vocab_size=256)
phases/10-llms-from-scratch/06-instruction-tuning-sft/code/main.py:56
↓ 2 callersFunctiontokenize_multiscale
Residual VQ: each scale tokenizes what previous scales missed.
phases/08-generative-ai/19-visual-autoregressive-var/code/main.py:106
↓ 2 callersFunctiontokenize_pair
(query: str, document: str, max_len: int = 96)
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:282
↓ 2 callersFunctiontokenize_text
(text: str)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:193
↓ 2 callersMethodtokens_per_target_call
(self)
phases/19-capstone-projects/14-speculative-decoding-server/code/main.py:116
↓ 2 callersFunctiontoolReadFile
(sandbox: string, args: ToolArgs)
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/tools.ts:11
↓ 2 callersFunctiontool_send
(to: str, body: str, result: AgentResult)
phases/18-ethics-safety-alignment/15-indirect-prompt-injection/code/main.py:46
↓ 2 callersFunctiontools_call
(name: str, args: dict, meta: dict | None = None)
phases/13-tools-and-protocols/13-mcp-async-tasks/code/main.py:104
↓ 2 callersFunctiontop_k
(scored: dict[str, float], k: int = 3)
phases/12-multimodal-ai/24-multimodal-rag-cross-modal/code/main.py:85
↓ 2 callersFunctiontop_k_distribution
(logits, k)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:252
↓ 2 callersFunctiontop_k_filter
(logits: torch.Tensor, top_k: int)
phases/19-capstone-projects/35-gpt-model-assembly/code/main.py:183
↓ 2 callersFunctiontop_p_distribution
(logits, p)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:281
↓ 2 callersMethodtop_words
(self, cls, n=10)
phases/01-math-foundations/07-bayes-theorem/code/bayes.py:78
↓ 2 callersMethodtotalTurnTokens
()
phases/11-llm-engineering/05-context-engineering/code/main.ts:123
↓ 2 callersMethodtotal_sum
(self, labels: dict[str, str] | None = None)
phases/19-capstone-projects/28-observability-otel-traces/code/main.py:254
↓ 2 callersFunctiontotal_variation
(p: np.ndarray, q: np.ndarray)
phases/10-llms-from-scratch/25-speculative-decoding/code/main.py:81
↓ 2 callersFunctiontoy_detector_score
(audio)
phases/06-speech-and-audio/16-anti-spoofing-audio-watermarking/code/main.py:50
↓ 2 callersMethodtpot_genaiperf
GenAI-Perf: ITL starts from token 2.
phases/17-infrastructure-and-production/08-inference-metrics-goodput/code/main.py:34
↓ 2 callersFunctiontrace
(label: str, state: State)
phases/18-ethics-safety-alignment/25-echoleak-cves-for-ai/code/main.py:78
↓ 2 callersFunctiontrain
(data, steps: int = 200, lr: float = 0.1, sample_weights=None)
phases/18-ethics-safety-alignment/21-fairness-criteria-group-individual-counterfactual/code/main.py:37
↓ 2 callersFunctiontrain
Run the training loop, persist losses.jsonl, return the in-memory log.
phases/19-capstone-projects/36-training-loop-eval/code/main.py:312
↓ 2 callersFunctiontrainBpe
(text: string, numMerges: number)
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.ts:94
↓ 2 callersFunctiontrain_and_eval
(model, train_loader, val_loader, device, epochs=2, base_lr=1e-3, freeze_bn=False)
phases/04-computer-vision/05-transfer-learning/code/main.py:91
↓ 2 callersFunctiontrain_bpe
(text, num_merges)
phases/05-nlp-foundations-to-advanced/19-subword-tokenization/code/main.py:40
↓ 2 callersFunctiontrain_sft
( model: TinyGPT, train_loader: DataLoader, cfg: SFTConfig, eval_pairs: Optional[Sequence[Dict
phases/19-capstone-projects/39-instruction-tuning-sft/code/main.py:476
↓ 2 callersFunctiontrain_strong
Fit a 3-feature linear classifier by SGD.
phases/18-ethics-safety-alignment/11-scalable-oversight-weak-to-strong/code/main.py:38
↓ 2 callersMethodtransform
(self, X)
phases/01-math-foundations/10-dimensionality-reduction/code/dim_reduction.py:31
↓ 2 callersMethodtransform
(self, X)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:107
↓ 2 callersFunctiontransformer_params
(n_layers, d_model, d_ff, n_heads, vocab)
phases/06-speech-and-audio/05-whisper-architecture-finetuning/code/main.py:54
↓ 2 callersFunctiontruncateEmbedding
(vec: Vec, dimensions: number)
phases/11-llm-engineering/04-embeddings/code/main.ts:214
↓ 2 callersFunctiontruncate_embedding
(vec, dimensions)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:186
↓ 2 callersFunctiontruncate_matryoshka
(vec, new_dim)
phases/05-nlp-foundations-to-advanced/22-embedding-models-deep-dive/code/main.py:34
↓ 2 callersFunctiontruncated_normal_demo
(mu, sigma, a, b, n=5000)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:59
↓ 2 callersFunctiontuple_from_nested
(obj)
phases/19-capstone-projects/47-checkpoint-save-resume/code/main.py:103
↓ 2 callersFunctionuct
(parent: Node, child: Node, c: float = 1.4)
phases/14-agent-engineering/04-tree-of-thoughts-lats/code/main.py:94
↓ 2 callersFunctionunfold_then_linear
Reference implementation of patch projection via unfold + matmul. Used by the tests to assert that the Conv2d projection matches the flatten-
phases/19-capstone-projects/58-vision-encoder-patches/code/main.py:149
↓ 2 callersFunctionunfreeze_body
(model: Classifier)
phases/19-capstone-projects/38-classifier-finetuning/code/main.py:182
↓ 2 callersFunctionuniform_sample
(duration: float, n: int)
phases/12-multimodal-ai/17-video-language-temporal-grounding/code/main.py:18
↓ 2 callersFunctionunwatermarked_sample
(n: int, seed_prefix: list[int])
phases/18-ethics-safety-alignment/23-watermarking-synthid-stable-signature-c2pa/code/main.py:34
↓ 2 callersMethodupdate
(self, is_speech, chunk_ms=20)
phases/06-speech-and-audio/14-voice-activity-detection-turn-taking/code/main.py:48
↓ 2 callersFunctionuri_in_roots
(uri: str)
phases/13-tools-and-protocols/12-mcp-roots-and-elicitation/code/main.py:27
↓ 2 callersMethodused_bytes
(self)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:37
↓ 2 callersMethodvalid_next
(self, state)
phases/05-nlp-foundations-to-advanced/20-structured-outputs-constrained-decoding/code/main.py:13
↓ 2 callersFunctionvalidate
(value: Any, schema: dict[str, Any], path: str = "$")
phases/14-agent-engineering/34-repo-memory-and-state/code/main.py:76
↓ 2 callersFunctionvalidate_corpus
Recompute each shard's sha256 over its on-disk tokens and report mismatches.
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:471
↓ 2 callersFunctionvalue
(w, x)
phases/09-reinforcement-learning/08-ppo/code/main.py:45
↓ 2 callersFunctionvalueAt
(s, ep)
site/figures-genai-rl.js:199
↓ 2 callersFunctionvariance_naive
(values)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:156
↓ 2 callersFunctionvec
(n: int)
phases/12-multimodal-ai/05-llava-visual-instruction-tuning/code/main.py:26
↓ 2 callersFunctionvec
(x2, y2, st)
site/lesson-figures.js:606
↓ 2 callersFunctionverifier
Run the code in a sandbox namespace and execute the tests. Deterministic.
phases/16-multi-agent-and-swarms/08-role-specialization/code/main.py:70
↓ 2 callersFunctionverify
( art: Artifacts, strict: bool = False, coverage_floor: float = COVERAGE_FLOOR_DEFAULT, )
phases/14-agent-engineering/38-verification-gates/code/main.py:140
↓ 2 callersMethodverify
(did: string, signature: string, payload: string)
phases/16-multi-agent-and-swarms/03-communication-protocols/code/main.ts:404
↓ 2 callersFunctionverify_pinned
(server: str, tool_name: str, live_desc: str)
phases/13-tools-and-protocols/17-mcp-gateways-and-registries/code/main.py:105
↓ 2 callersFunctionverify_regex_match
Match a regex against a file in scratch_dir.
phases/19-capstone-projects/27-eval-harness-fixture-tasks/code/main.py:186
↓ 2 callersFunctionverify_resume
Reload the checkpoint and compare master shards byte-equal to the snapshot. Each rank captured its master shard at the moment of the checkpoint w
phases/19-capstone-projects/81-end-to-end-distributed-train/code/main.py:401
↓ 2 callersMethodvocab_size
(self)
phases/10-llms-from-scratch/03-data-pipelines/code/main.py:154
↓ 2 callersFunctionweak_label
Weak labeler: simple threshold on x[0] alone, plus noise to reach target accuracy. Misses the x[1] and x[2] signals.
phases/18-ethics-safety-alignment/11-scalable-oversight-weak-to-strong/code/main.py:29
↓ 2 callersFunctionweat_score
(identity_a: list[str], identity_b: list[str], attr_x: list[str], attr_y: list[str])
phases/18-ethics-safety-alignment/20-bias-representational-harm/code/main.py:48
↓ 2 callersFunctionwelford_variance
(values)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:141
↓ 2 callersFunctionword_shape
(word)
phases/05-nlp-foundations-to-advanced/06-named-entity-recognition/code/main.py:6
↓ 2 callersFunctionworkflow
Three-activity workflow with an optional crash for pedagogy.
phases/15-autonomous-systems/12-durable-execution/code/main.py:91
↓ 2 callersMethodworkspaceFiles
()
phases/19-capstone-projects/10-multi-agent-software-team/code/ts/src/coordinator.ts:56
↓ 2 callersMethodwrite_error
(self, rid: int | str | None, code: int, message: str, data: Any | None = None)
phases/19-capstone-projects/22-jsonrpc-stdio-transport/code/main.py:125
↓ 2 callersFunctionwrite_jsonl
(path: str, records: Iterable[dict])
phases/19-capstone-projects/70-task-spec-format/code/main.py:376
↓ 2 callersMethodwrite_shard
(self, shard_id: str, documents: Iterable[str])
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:218
↓ 2 callersFunctionwrite_taxonomy_json
(tax: Taxonomy)
phases/19-capstone-projects/82-jailbreak-taxonomy/code/main.py:171
↓ 2 callersMethodzero_grad
(self)
phases/03-deep-learning-core/03-backpropagation/code/main.py:131
↓ 2 callersFunctionzero_init
(fan_in, fan_out)
phases/03-deep-learning-core/08-weight-initialization/code/main.py:5
↓ 1 callersMethod__add__
(self, other)
phases/03-deep-learning-core/03-backpropagation/code/main.py:16
↓ 1 callersMethod__add__
(self, other)
phases/01-math-foundations/05-chain-rule-and-autodiff/code/autodiff.py:15
↓ 1 callersMethod__add__
(self, other)
phases/01-math-foundations/19-complex-numbers/code/complex_numbers.py:10
↓ 1 callersMethod__add__
(self, other)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:9
↓ 1 callersMethod__init__
(self)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:46
↓ 1 callersMethod__init__
(self)
phases/04-computer-vision/16-vision-pipeline-capstone/code/main.py:34
↓ 1 callersMethod__init__
(self, num_classes=10)
phases/04-computer-vision/13-3d-vision-nerf/code/main.py:7
↓ 1 callersMethod__init__
(self, z_dim=64, img_channels=3, feat=32)
phases/04-computer-vision/09-image-generation-gans/code/main.py:10
↓ 1 callersMethod__init__
(self, X, Y, transform=None)
phases/04-computer-vision/04-image-classification/code/main.py:33
↓ 1 callersMethod__init__
(self, vit_dim=32, llm_dim=64, num_classes=5)
phases/04-computer-vision/25-vision-language-models/code/main.py:20
← previousnext →2,401–2,500 of 8,347, ranked by callers