MCPcopy Create free account

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

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

↓ 8 callersMethodcontent_hash
(self)
phases/19-capstone-projects/07-end-to-end-fine-tuning-pipeline/code/main.py:33
↓ 8 callersFunctioncosine_similarity
(a, b)
phases/01-math-foundations/14-norms-and-distances/code/distances.py:44
↓ 8 callersMethodcount_windows
(num_ids: int, context_length: int, stride: int)
phases/19-capstone-projects/31-tokenized-dataset-sliding-window/code/main.py:177
↓ 8 callersFunctiondecode
Decode `ids` back to a string. Inverse of `encode` for round-trip safe input.
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:220
↓ 8 callersFunctiondet_2x2
(m)
phases/01-math-foundations/03-matrix-transformations/code/transformations.py:56
↓ 8 callersFunctiondot_product
(a, b)
phases/01-math-foundations/14-norms-and-distances/code/distances.py:40
↓ 8 callersFunctiondpo_loss
Per-example DPO loss and the implicit reward margin. L = -log sigmoid( beta * ( (logp_w_pol - logp_w_ref) - (logp_l_pol - logp_l_ref) ) ) Re
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:236
↓ 8 callersMethodencode
(self, text)
phases/10-llms-from-scratch/01-tokenizers/code/main.py:51
↓ 8 callersFunctionescapeHtml
(value: string)
phases/19-capstone-projects/04-multimodal-document-qa/code/ts/src/render.ts:4
↓ 8 callersFunctioneuler
(theta)
phases/01-math-foundations/19-complex-numbers/code/complex_numbers.py:79
↓ 8 callersMethodevaluate
(self, call: ToolCall, ctx: GateContext)
phases/19-capstone-projects/25-verification-gates-observation-budget/code/main.py:173
↓ 8 callersMethodexecute
(self, name: str, context: dict[str, Any] | None = None)
phases/14-agent-engineering/10-skill-libraries-voyager/code/main.py:85
↓ 8 callersMethodfire
(self, event: str, payload: dict[str, Any])
phases/19-capstone-projects/01-terminal-native-coding-agent/code/main.py:94
↓ 8 callersFunctionfixture_tasks
()
phases/19-capstone-projects/75-end-to-end-eval-runner/code/tests/test_runner.py:47
↓ 8 callersFunctionin_text
(idx: int)
phases/12-multimodal-ai/13-transfusion-autoregressive-diffusion/code/main.py:63
↓ 8 callersMethodlisten
(self, topic: str)
phases/14-agent-engineering/15-crewai-role-based-crews/code/main.py:135
↓ 8 callersFunctionload_safetensors
Load weights into model. Refuse to assign on shape mismatch. Returns a report.
phases/19-capstone-projects/37-loading-pretrained-weights/code/main.py:212
↓ 8 callersFunctionmake_batches
Yield (input, target) batches where target is input shifted by one position. Sampling is uniform random over valid start positions. With a fixed
phases/19-capstone-projects/36-training-loop-eval/code/main.py:181
↓ 8 callersFunctionmatvec
(M: List[List[float]], v: List[float])
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:27
↓ 8 callersMethodnormalize
(self)
phases/12-multimodal-ai/10-internvl3-native-multimodal/code/main.py:23
↓ 8 callersMethodon
(self, topic: str, fn: Callable[[dict], Any])
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:124
↓ 8 callersFunctionpercentile
(sorted: number[], p: number)
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/rollup.ts:4
↓ 8 callersMethodpredict
(self, X)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:101
↓ 8 callersFunctionpretty
human-readable.
phases/07-transformers-deep-dive/13-scaling-laws/code/main.py:38
↓ 8 callersMethodprocess
(self, prompt: str)
phases/19-capstone-projects/15-constitutional-safety-harness/code/main.py:99
↓ 8 callersFunctionpx
(f)
site/figures-vision-speech.js:304
↓ 8 callersFunctionpy
(y)
site/figures-transformers.js:196
↓ 8 callersFunctionread
()
site/progress.js:33
↓ 8 callersFunctionrefuseReason
(args: LaunchArgs)
phases/19-capstone-projects/10-multi-agent-software-team/code/ts/src/runtime.ts:48
↓ 8 callersMethodrun
(self, spec: ExperimentSpec)
phases/19-capstone-projects/52-experiment-runner/code/main.py:182
↓ 8 callersMethodrun
(self, paper: MiniPaper)
phases/19-capstone-projects/55-critic-loop/code/main.py:166
↓ 8 callersFunctionrun_mesh
Run the chosen primitive on the queue mesh and return per-rank outputs plus byte total.
phases/19-capstone-projects/76-collective-ops-from-scratch/code/main.py:300
↓ 8 callersFunctionsave_sharded
Write per-rank state files atomically; return the manifest written. per_rank_state is a list indexed by rank. Each entry is a state dict that
phases/19-capstone-projects/80-checkpoint-sharded-resume/code/main.py:105
↓ 8 callersMethodset
(key: K, value: V)
phases/17-infrastructure-and-production/14-prompt-semantic-caching/code/main.ts:64
↓ 8 callersFunctionshell
(host, label, hint, grid, outKids, cap)
site/figures-nlp2.js:11
↓ 8 callersFunctionshell
(label, hint, grid, outKids, caption)
site/figures-vision-speech.js:15
↓ 8 callersFunctionsigmoid
(x: float)
phases/18-ethics-safety-alignment/03-direct-preference-optimization-family/code/main.py:39
↓ 8 callersFunctionsimulate_float16
(x)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:122
↓ 8 callersFunctionspan
(model: string, latencyMs: number, status: "OK" | "ERROR" = "OK")
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/tests/rollup.test.ts:6
↓ 8 callersMethodstep
(self, batch_inputs: torch.Tensor, batch_targets: torch.Tensor)
phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py:158
↓ 8 callersFunctionsynthCall
(script: string, startMs = 0, noise = 0)
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/vad.ts:14
↓ 8 callersFunctiontokenize
(text)
phases/05-nlp-foundations-to-advanced/27-llm-evaluation-frameworks/code/main.py:9
↓ 8 callersFunctiontokenize
(text: str)
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:45
↓ 8 callersFunctiontrain_test_split
(X, y, test_ratio=0.2, seed=42)
phases/02-ml-fundamentals/11-ensemble-methods/code/ensembles.py:20
↓ 8 callersMethodupdate
(self, tid: str, **changes)
phases/13-tools-and-protocols/13-mcp-async-tasks/code/main.py:77
↓ 8 callersFunctionvariance
(data, sample=True)
phases/01-math-foundations/15-statistics-for-ml/code/statistics.py:30
↓ 8 callersMethodwrite_corpus
(self, shards: dict[str, Iterable[str]])
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:227
↓ 8 callersMethodzero_grad
(self)
phases/19-capstone-projects/78-zero-parameter-sharding/code/main.py:161
↓ 7 callersMethod__init__
(self, parameters, lr=0.01)
phases/03-deep-learning-core/10-mini-framework/code/main.py:282
↓ 7 callersFunction_baseline_tokens
(text: str)
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:268
↓ 7 callersFunction_indent_of
(line: str)
phases/19-capstone-projects/86-constitutional-rules-engine/code/yaml_subset.py:45
↓ 7 callersFunction_make_root
()
phases/19-capstone-projects/26-sandbox-runner-denylist/code/tests/test_main.py:29
↓ 7 callersFunction_tiny_cfg
(**overrides)
phases/19-capstone-projects/37-loading-pretrained-weights/code/tests/test_load.py:31
↓ 7 callersMethodact
(self, memory: EpisodicMemory)
phases/14-agent-engineering/03-reflexion-verbal-rl/code/main.py:42
↓ 7 callersFunctionadd
(a, b)
phases/08-generative-ai/02-autoencoders-vae/code/main.py:9
↓ 7 callersMethodadd
(self, doc: Doc)
phases/19-capstone-projects/65-hybrid-retrieval-bm25-dense/code/main.py:67
↓ 7 callersMethodadd_paper
(self, paper: Paper)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:117
↓ 7 callersMethodanswer
(self, correct: str, rng: random.Random)
phases/16-multi-agent-and-swarms/15-voting-debate-topology/code/main.py:21
↓ 7 callersFunctionarrow
(x2, y2, st, w)
site/figures-math.js:21
↓ 7 callersFunctionbleu4
(prediction: str, reference: str, max_n: int = 4)
phases/19-capstone-projects/71-classical-metrics/code/main.py:83
↓ 7 callersFunctionbubble_fraction
Closed-form bubble fraction per stage for GPipe. Forward takes M + N - 1 cycles per stage (M useful + N - 1 idle warmup). Backward takes M +
phases/19-capstone-projects/79-pipeline-parallel/code/main.py:37
↓ 7 callersFunctionbuildApp
(options: AppOptions = {})
phases/19-capstone-projects/06-devops-troubleshooting-agent/code/ts/src/server.ts:26
↓ 7 callersFunctionbuildIndex
* Build the flat search index once from window.PHASES and window.GLOSSARY. * Idempotent: subsequent calls return the cached array.
site/cmdpalette.js:33
↓ 7 callersFunctionbuild_demo_scripts
Scripted responses for the demo seed prompt across temperature buckets.
phases/19-capstone-projects/50-hypothesis-generator/code/main.py:258
↓ 7 callersFunctionclassify_refusal
(response: str)
phases/19-capstone-projects/84-refusal-evaluation/code/main.py:54
↓ 7 callersFunctioncompute_metrics
(y_true, y_pred)
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:139
↓ 7 callersFunctioncount_tokens
(text)
phases/11-llm-engineering/05-context-engineering/code/main.py:6
↓ 7 callersFunctiondeterministic_score
Score a paper deterministically across the five dimensions, 0..10 each.
phases/19-capstone-projects/55-critic-loop/code/main.py:214
↓ 7 callersMethodencode
(self, text)
phases/10-llms-from-scratch/02-building-a-tokenizer/code/main.py:97
↓ 7 callersMethodencode_pair
Return (token_ids, response_start_index). Truncates to max_len if needed but always keeps the RESP marker plus at least one response t
phases/19-capstone-projects/39-instruction-tuning-sft/code/main.py:46
↓ 7 callersFunctionentropy
(probs, base=2)
phases/01-math-foundations/09-information-theory/code/information_theory.py:13
↓ 7 callersFunctionexact_match
(prediction: str, targets: list[str])
phases/19-capstone-projects/71-classical-metrics/code/main.py:27
↓ 7 callersFunctionexpectedSig
(body: Buffer | string, secret: string)
phases/19-capstone-projects/16-github-issue-to-pr-agent/code/ts/src/verify.ts:3
↓ 7 callersFunctionextract_answer
(text)
phases/11-llm-engineering/02-few-shot-cot/code/advanced_prompting.py:104
↓ 7 callersFunctionf
(x)
phases/01-math-foundations/18-convex-optimization/code/convex.py:214
↓ 7 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:62
↓ 7 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:90
↓ 7 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/15-time-series/code/time_series.py:112
↓ 7 callersMethodfit_transform
(self, X)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:74
↓ 7 callersFunctionfmt_billions
(x: int)
phases/10-llms-from-scratch/14-open-models-architecture-walkthroughs/code/main.py:240
↓ 7 callersFunctiongenerate
Autoregressive generation with multinomial sampling, temperature, top-k. Holds the active window to model.cfg.context_length by sliding the oldes
phases/19-capstone-projects/35-gpt-model-assembly/code/main.py:192
↓ 7 callersMethodget
(self, name: str)
phases/19-capstone-projects/23-function-call-dispatcher/code/main.py:88
↓ 7 callersMethodgetOrCreate
(id: string, role: string, jurisdiction: string)
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/session.ts:6
↓ 7 callersMethodgrad_logprob
(self, a: int)
phases/18-ethics-safety-alignment/03-direct-preference-optimization-family/code/main.py:63
↓ 7 callersFunctionhasShellMetachars
(arg: string)
phases/19-capstone-projects/10-multi-agent-software-team/code/ts/src/runtime.ts:40
↓ 7 callersMethodinc
(self, labels: dict[str, str] | None = None, by: float = 1.0)
phases/19-capstone-projects/28-observability-otel-traces/code/main.py:205
↓ 7 callersFunctioninject_lora
(model, target_modules, rank=8, alpha=16)
phases/11-llm-engineering/08-fine-tuning-lora/code/lora.py:35
↓ 7 callersFunctionload_sharded
Read the manifest, verify every shard, return (manifest, per-rank state list).
phases/19-capstone-projects/80-checkpoint-sharded-resume/code/main.py:159
↓ 7 callersFunctionmake_stub_safetensors
Generate a fixture file with the pretrained naming convention. Tensors are random but reproducible from `seed`. Shapes match what a real GPT-
phases/19-capstone-projects/37-loading-pretrained-weights/code/main.py:283
↓ 7 callersFunctionmatmul
(W, x)
phases/08-generative-ai/02-autoencoders-vae/code/main.py:5
↓ 7 callersFunctionmodel_fn
(batch)
phases/10-llms-from-scratch/05-scaling-distributed/code/main.py:256
↓ 7 callersFunctionneg_mse
(model, X, y)
phases/02-ml-fundamentals/12-hyperparameter-tuning/code/tuning.py:118
↓ 7 callersFunctionnormal_pdf
(x, mu, sigma)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:25
↓ 7 callersFunctionnormalise_for_em
(text: str)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:189
↓ 7 callersFunctionnormalise_metric
Map a raw metric onto [0, 1].
phases/19-capstone-projects/41-eval-pipeline/code/main.py:624
↓ 7 callersMethodon
(event: HookEvent, fn: HookFn)
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/hooks.ts:21
↓ 7 callersFunctionpad
(s: string | number, n: number, left = true)
phases/17-infrastructure-and-production/13-llm-observability/code/main.ts:289
↓ 7 callersFunctionpass_at_k
Probability of at least one pass in k independent samples.
phases/19-capstone-projects/27-eval-harness-fixture-tasks/code/main.py:132
↓ 7 callersFunctionprint_confusion_matrix
(y_true, y_pred, label="")
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:186
↓ 7 callersFunctionprint_metrics
(metrics, label="")
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:194
← previousnext →301–400 of 8,347, ranked by callers