MCPcopy Create free account

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

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

↓ 5 callersFunctiontrain_lora
(model, data, epochs=5, lr=1e-3, batch_size=4)
phases/11-llm-engineering/08-fine-tuning-lora/code/lora.py:122
↓ 5 callersFunctiontrain_test_split
(X, y, test_ratio=0.2, seed=42)
phases/02-ml-fundamentals/14-naive-bayes/code/naive_bayes.py:157
↓ 5 callersFunctiontrain_tiny
Returns per-epoch loss.
phases/19-capstone-projects/66-reranker-cross-encoder/code/main.py:130
↓ 5 callersFunctiontrue_score
(agent: Agent)
phases/15-autonomous-systems/04-darwin-godel-machine/code/main.py:71
↓ 5 callersMethodupdate
(self, bbox, frame)
phases/04-computer-vision/27-multi-object-tracking/code/main.py:26
↓ 5 callersFunctionvalue
(node: Node)
phases/14-agent-engineering/04-tree-of-thoughts-lats/code/main.py:68
↓ 5 callersFunctionvec
(n: int)
phases/12-multimodal-ai/04-flamingo-gated-cross-attention/code/main.py:20
↓ 5 callersFunctionvisualize_schedule
(name, schedule_fn, total_steps=500, **kwargs)
phases/03-deep-learning-core/09-learning-rate-schedules/code/main.py:37
↓ 5 callersMethodwalk
Return number of tokens that are already cached at the longest matching prefix, bumping last_used along the path.
phases/17-infrastructure-and-production/06-sglang-radixattention/code/main.py:51
↓ 5 callersFunctionwhichVersion
(cmd: string, args: string[] = ["--version"])
phases/00-setup-and-tooling/01-dev-environment/code/verify.ts:16
↓ 5 callersMethodwrite
(self, manifest_path: Path)
phases/19-capstone-projects/42-large-corpus-downloader/code/main.py:436
↓ 5 callersMethodwrite_short_term
(self, role: str, value: str)
phases/14-agent-engineering/15-crewai-role-based-crews/code/main.py:179
↓ 4 callersFunctionP
(x, y)
site/figures-math.js:61
↓ 4 callersMethod__init__
(self, num_classes=10)
phases/04-computer-vision/03-cnns-lenet-to-resnet/code/main.py:7
↓ 4 callersMethod__init__
(self, cfg: ModelConfig)
phases/19-capstone-projects/36-training-loop-eval/code/main.py:140
↓ 4 callersMethod__init__
(self, cfg: ModelConfig)
phases/19-capstone-projects/37-loading-pretrained-weights/code/main.py:125
↓ 4 callersMethod__init__
(self, cfg: ViTConfig)
phases/19-capstone-projects/59-vit-transformer/code/main.py:137
↓ 4 callersMethod__init__
(self, cfg: DecoderConfig)
phases/19-capstone-projects/61-cross-attention-fusion/code/main.py:136
↓ 4 callersMethod__init__
(self, d_model: int, eps: float = 1e-5)
phases/19-capstone-projects/34-transformer-block/code/main.py:45
↓ 4 callersMethod__init__
(self, cfg: GPTConfig)
phases/19-capstone-projects/35-gpt-model-assembly/code/main.py:126
↓ 4 callersMethod__init__
(self, vocab_size, d, h, n_layers, block_size, expansion)
phases/07-transformers-deep-dive/14-build-a-transformer-capstone/code/main.py:183
↓ 4 callersFunction_beta_sample
(alpha, beta_param, rng_module)
phases/01-math-foundations/07-bayes-theorem/code/bayes.py:310
↓ 4 callersFunction_build_components
(total_steps: int = 10, lr: float = 0.01)
phases/19-capstone-projects/47-checkpoint-save-resume/code/test_main.py:20
↓ 4 callersFunction_bullets
(items: list[str])
phases/14-agent-engineering/40-multi-session-handoff/code/main.py:94
↓ 4 callersFunction_check_argv_interpreter
(argv: Sequence[str], cfg: SandboxConfig)
phases/19-capstone-projects/26-sandbox-runner-denylist/code/main.py:167
↓ 4 callersMethod_compute_strides
(shape)
phases/01-math-foundations/12-tensor-operations/code/tensors.py:48
↓ 4 callersFunction_content_tokens
(text: str)
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:109
↓ 4 callersFunction_load_json
(path: Path, default)
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/scripts/generate_handoff.py:15
↓ 4 callersMethod_make_group
(self, in_c, out_c, num_blocks, stride)
phases/04-computer-vision/03-cnns-lenet-to-resnet/code/main.py:98
↓ 4 callersMethod_make_leaf
(self, y)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:145
↓ 4 callersFunction_ngram_counts
(tokens: list[str], n: int)
phases/19-capstone-projects/71-classical-metrics/code/main.py:55
↓ 4 callersFunction_print_section
(title: str)
phases/19-capstone-projects/33-multihead-self-attention/code/main.py:230
↓ 4 callersFunction_print_section
(title: str)
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:290
↓ 4 callersFunction_process_capture
Truncate first, then redact. Returns (text, cut_lines, redaction_hits).
phases/14-agent-engineering/37-runtime-feedback-loops/code/main.py:78
↓ 4 callersFunction_scan_intermediates
Walk stdout lines and pull every json line whose keys cover metric_keys. The last covering line is treated as the final metrics. Earlier lines ar
phases/19-capstone-projects/52-experiment-runner/code/main.py:148
↓ 4 callersMethod_split_heads
(self, x: torch.Tensor)
phases/19-capstone-projects/33-multihead-self-attention/code/main.py:55
↓ 4 callersFunction_state_fingerprint
Sum of L2 norms across parameters; coarse fingerprint that changes on load.
phases/19-capstone-projects/37-loading-pretrained-weights/code/main.py:340
↓ 4 callersMethod_step
(self)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:267
↓ 4 callersFunction_synthetic_byte_tokens
Deterministic synthetic tokens. Bytes drawn from a small repeating pattern so the model has structure to learn in a handful of steps; the eva
phases/19-capstone-projects/36-training-loop-eval/code/main.py:369
↓ 4 callersMethod_trained
(self)
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/tests/test_bpe.py:81
↓ 4 callersFunction_validate_probs
(confidences: np.ndarray, correct: np.ndarray)
phases/19-capstone-projects/73-perplexity-calibration/code/main.py:57
↓ 4 callersFunctionaccuracy
(model: LogReg, data: list[Example])
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:100
↓ 4 callersFunctionadd
(a, b)
phases/08-generative-ai/03-gans-generator-discriminator/code/main.py:29
↓ 4 callersFunctionadd
(a, b)
phases/08-generative-ai/04-conditional-gans-pix2pix/code/main.py:29
↓ 4 callersMethodadd
(self, c: Chunk)
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:153
↓ 4 callersMethodadd_special_token
(self, token_str)
phases/10-llms-from-scratch/02-building-a-tokenizer/code/main.py:90
↓ 4 callersMethodanomaly_score
(self, X)
phases/02-ml-fundamentals/16-anomaly-detection/code/anomaly_detection.py:115
↓ 4 callersFunctionapply_grad
(p: Policy, grad: list[float], lr: float)
phases/18-ethics-safety-alignment/03-direct-preference-optimization-family/code/main.py:68
↓ 4 callersFunctionapply_rope
Rotate even/odd pairs of x by angle pos * theta_i.
phases/07-transformers-deep-dive/04-positional-encoding/code/main.py:21
↓ 4 callersMethodassess
(self, call: ToolCall, contents: list[Content])
phases/14-agent-engineering/27-prompt-injection-defense/code/main.py:53
↓ 4 callersFunctionb64url_decode
(s: str)
phases/13-tools-and-protocols/18-mcp-auth-production/code/main.py:40
↓ 4 callersFunctionbaseline_cost
(requests: list[Request], provider: str)
phases/11-llm-engineering/15-prompt-caching/code/main.py:121
↓ 4 callersFunctionbench
(label: str, runner)
phases/16-multi-agent-and-swarms/20-marl-maddpg-qmix-mappo/code/main.py:131
↓ 4 callersFunctionbootstrap_mean_ci
( scores: Sequence[float], b: int = 1000, alpha: float = 0.05, seed: int = 0, )
phases/19-capstone-projects/74-leaderboard-aggregation/code/main.py:100
↓ 4 callersFunctionbootstrap_pairwise_diff
( paired_a: Sequence[float], paired_b: Sequence[float], b: int = 1000, alpha: float = 0.05,
phases/19-capstone-projects/74-leaderboard-aggregation/code/main.py:120
↓ 4 callersFunctionbox
(x, y, w, h, label, on)
site/figures-agents-alignment.js:17
↓ 4 callersFunctionbox
(x, y, w, h, label, fill)
site/figures-transformers.js:365
↓ 4 callersFunctionbuild_demo_corpus
Two shards of synthetic documents long enough to exercise mmap reads.
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:486
↓ 4 callersFunctionbuild_model
(cfg: SFTConfig)
phases/19-capstone-projects/39-instruction-tuning-sft/code/main.py:464
↓ 4 callersFunctionbuild_param_groups
Split parameters: matrix-shaped tensors get decay; scale/bias/embedding biases do not.
phases/19-capstone-projects/36-training-loop-eval/code/main.py:279
↓ 4 callersFunctionbullets
(items)
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/scripts/generate_handoff.py:76
↓ 4 callersFunctioncall
(name: str, args: dict)
phases/13-tools-and-protocols/12-mcp-roots-and-elicitation/code/main.py:117
↓ 4 callersFunctioncausal_mask
Lower-triangular boolean mask of shape (length, length). Cell [i, j] is True if token i may attend to token j (j <= i).
phases/19-capstone-projects/61-cross-attention-fusion/code/main.py:45
↓ 4 callersFunctionchat_turn
(query: str, role: str, jurisdiction: str, corpus: list[Chunk], cache: PromptCache)
phases/19-capstone-projects/08-production-rag-chatbot/code/main.py:179
↓ 4 callersFunctioncheckBudget
(m: Migration)
phases/19-capstone-projects/09-code-migration-agent/code/ts/src/cost.ts:15
↓ 4 callersFunctioncheck_tensor
(name, values)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:102
↓ 4 callersFunctioncholesky
(A)
phases/01-math-foundations/17-linear-systems/code/linear_systems.py:62
↓ 4 callersFunctioncholesky_solve
(L, b)
phases/01-math-foundations/17-linear-systems/code/linear_systems.py:79
↓ 4 callersFunctionclass_weighted_loss
(y_true, y_pred_probs, weights)
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:124
↓ 4 callersFunctionclip_global_l2_norm
Clip gradients in place to max_norm and return (pre_clip, post_clip). Returns (pre_clip, post_clip). When pre_clip <= max_norm the gradients are
phases/19-capstone-projects/45-gradient-clipping-amp/code/main.py:100
↓ 4 callersFunctioncohens_d
(data1, data2)
phases/01-math-foundations/15-statistics-for-ml/code/statistics.py:278
↓ 4 callersFunctioncompliance_probability
Returns P(comply) under the model: expected-utility decision between refusing and complying. refuse utility = -harm_aversion*0 + preservati
phases/18-ethics-safety-alignment/09-alignment-faking/code/main.py:30
↓ 4 callersFunctioncompute_global_l2_norm
Compute the Euclidean norm over all gradients without clipping.
phases/19-capstone-projects/45-gradient-clipping-amp/code/main.py:88
↓ 4 callersFunctionconditional_entropy
(joint_probs, base=2)
phases/01-math-foundations/09-information-theory/code/information_theory.py:75
↓ 4 callersFunctioncopy_model_weights
(source, target)
phases/10-llms-from-scratch/08-dpo/code/main.py:121
↓ 4 callersFunctioncosine
(a, b)
phases/06-speech-and-audio/08-voice-cloning-conversion/code/main.py:50
↓ 4 callersFunctioncosineSimilarity
(a: number[], b: number[])
phases/11-llm-engineering/06-rag/code/main.ts:57
↓ 4 callersFunctioncosine_similarity
(a, b)
phases/03-deep-learning-core/05-loss-functions/code/main.py:76
↓ 4 callersFunctioncosine_similarity
(a, b)
phases/11-llm-engineering/06-rag/code/main.py:47
↓ 4 callersMethodcosine_similarity
(self, other)
phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py:25
↓ 4 callersFunctioncosine_with_warmup
Linear warmup then cosine decay to min_lr over the remaining steps.
phases/19-capstone-projects/36-training-loop-eval/code/main.py:296
↓ 4 callersFunctioncost_per_day
Effective $/day given the vendor's pricing model. Per-minute vendors are billed for the maximum of saturated serving time and a reserved-minu
phases/17-infrastructure-and-production/02-inference-platform-economics/code/main.py:36
↓ 4 callersFunctioncount_parameters
(model)
phases/11-llm-engineering/08-fine-tuning-lora/code/lora.py:55
↓ 4 callersMethodcount_parameters
(self)
phases/10-llms-from-scratch/04-pre-training-mini-gpt/code/main.py:105
↓ 4 callersMethodcreate
(self, skill: str, payload: dict)
phases/16-multi-agent-and-swarms/12-a2a-protocol/code/main.py:39
↓ 4 callersMethodcreate
(id: string, video_url: string, question: string, createdAt?: number)
phases/19-capstone-projects/12-video-understanding-pipeline/code/ts/src/jobs.ts:8
↓ 4 callersFunctioncreateSpecialist
( name: string, systemPrompt: string )
phases/16-multi-agent-and-swarms/01-why-multi-agent/code/single_vs_multi.ts:82
↓ 4 callersFunctioncross_entropy
(p, q, base=2)
phases/01-math-foundations/09-information-theory/code/information_theory.py:20
↓ 4 callersFunctioncross_validate
(X, y, model_fn, k=5, metric_fn=None, stratified=False)
phases/02-ml-fundamentals/09-model-evaluation/code/evaluation.py:71
↓ 4 callersMethoddecode
(self, ids: Sequence[int])
phases/19-capstone-projects/38-classifier-finetuning/code/main.py:50
↓ 4 callersFunctiondemoDelivery
( audit: AuditLog, event: string, payload: unknown, signingSecret: string, receiverSecret: string, )
phases/19-capstone-projects/16-github-issue-to-pr-agent/code/ts/src/index.ts:16
↓ 4 callersMethoddetail
(id: string)
phases/19-capstone-projects/12-video-understanding-pipeline/code/ts/src/jobs.ts:47
↓ 4 callersFunctiondeterministic_tail
(text: str)
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/scripts/run_with_feedback.py:18
↓ 4 callersFunctiondf
(t)
site/figures-nlp2.js:34
↓ 4 callersFunctiondiff
(draft: str, revised: str)
phases/19-capstone-projects/86-constitutional-rules-engine/code/main.py:201
↓ 4 callersMethoddistribution
(self, ctx_seed: int)
phases/19-capstone-projects/14-speculative-decoding-server/code/main.py:52
↓ 4 callersMethoddownload
(self, plan: ShardPlan)
phases/19-capstone-projects/42-large-corpus-downloader/code/main.py:312
↓ 4 callersFunctionemptyState
()
site/progress.js:29
↓ 4 callersMethodencode
(self, text)
phases/10-llms-from-scratch/03-data-pipelines/code/main.py:132
↓ 4 callersFunctionencodeFrame
(f: Frame)
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/protocol.ts:22
← previousnext →701–800 of 8,347, ranked by callers