Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/rohitg00/ai-engineering-from-scratch
/ functions
Functions
8,347 in github.com/rohitg00/ai-engineering-from-scratch
⨍
Functions
8,347
◇
Types & classes
1,490
↳
Endpoints
1
↓ 4 callers
Function
vqa_exact_match
(predictions: list[int], references: list[int])
phases/19-capstone-projects/63-multimodal-eval/code/main.py:100
↓ 4 callers
Function
wilson_confidence_interval
(successes, total, z=1.96)
phases/11-llm-engineering/10-evaluation/code/eval_framework.py:183
↓ 4 callers
Function
write
(state)
site/progress.js:45
↓ 4 callers
Function
writeFrame
(event: string, data: unknown)
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/server.ts:109
↓ 4 callers
Method
write_long_term
(self, role: str, value: str)
phases/14-agent-engineering/15-crewai-role-based-crews/code/main.py:182
↓ 4 callers
Function
zscore_detect
(X, threshold=3.0)
phases/02-ml-fundamentals/16-anomaly-detection/code/anomaly_detection.py:4
↓ 3 callers
Method
__init__
(self, in_c, out_c)
phases/04-computer-vision/07-semantic-segmentation-unet/code/main.py:35
↓ 3 callers
Method
__init__
(self, vocab_size: int, d_model: int)
phases/19-capstone-projects/33-multihead-self-attention/code/main.py:104
↓ 3 callers
Method
__init__
(self, vocab_size: int, d_model: int, init_std: float = DEFAULT_INIT_STD)
phases/19-capstone-projects/32-token-positional-embeddings/code/main.py:35
↓ 3 callers
Function
_add
(path: str)
phases/19-capstone-projects/57-end-to-end-research-demo/code/main.py:28
↓ 3 callers
Function
_agent_fn
(input_text: str)
phases/14-agent-engineering/29-production-runtimes/code/main.py:13
↓ 3 callers
Function
_bin_indices
(confidences: np.ndarray, n_bins: int)
phases/19-capstone-projects/73-perplexity-calibration/code/main.py:71
↓ 3 callers
Function
_build_ids
(target_vocab: int = 300)
phases/19-capstone-projects/31-tokenized-dataset-sliding-window/code/tests/test_dataset.py:29
↓ 3 callers
Function
_check_executable_denylist
(argv: Sequence[str], cfg: SandboxConfig)
phases/19-capstone-projects/26-sandbox-runner-denylist/code/main.py:156
↓ 3 callers
Method
_current_lr
(self)
phases/19-capstone-projects/45-gradient-clipping-amp/code/main.py:190
↓ 3 callers
Function
_ece
(results: list[TrialResult], n_bins: int = 10)
phases/19-capstone-projects/84-refusal-evaluation/code/main.py:89
↓ 3 callers
Method
_elementwise_op
(self, other, op)
phases/01-math-foundations/12-tensor-operations/code/tensors.py:180
↓ 3 callers
Method
_embed
(self, text: str)
phases/14-agent-engineering/15-crewai-role-based-crews/code/main.py:169
↓ 3 callers
Function
_encode_pretokenized
(tokenizer: BPETokenizer, text: str)
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:213
↓ 3 callers
Method
_expand
(self, subtasks: list[str], state: set[str], depth: int)
phases/14-agent-engineering/11-planning-htn-and-evolutionary/code/main.py:88
↓ 3 callers
Method
_flush_buffer
(self, final: bool)
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:168
↓ 3 callers
Function
_format_byte_token
(token_bytes: bytes)
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:295
↓ 3 callers
Method
_gini
(self, y)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:225
↓ 3 callers
Function
_hex
(n: int)
phases/13-tools-and-protocols/23-capstone-tool-ecosystem/code/main.py:32
↓ 3 callers
Function
_listEl
()
site/cmdpalette.js:285
↓ 3 callers
Function
_load_json
(path: Path, default)
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/scripts/verify_agent.py:14
↓ 3 callers
Function
_load_module
(name: str, path: Path)
phases/19-capstone-projects/62-vision-language-pretraining/code/main.py:30
↓ 3 callers
Function
_load_module
(name: str, file_path: str)
phases/19-capstone-projects/57-end-to-end-research-demo/code/main.py:41
↓ 3 callers
Function
_load_module
(name: str, path: Path)
phases/19-capstone-projects/87-end-to-end-safety-gate/code/safety_gate.py:27
↓ 3 callers
Function
_locate
(doc: str, span_text: str)
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:331
↓ 3 callers
Method
_log_event
(self, user_input, output, report)
phases/11-llm-engineering/12-guardrails/code/guardrails.py:362
↓ 3 callers
Function
_make_debater
(name: str, bias: str, corrections: dict[str, str])
phases/14-agent-engineering/25-multi-agent-debate/code/main.py:20
↓ 3 callers
Function
_modified_precision
(cand_tokens: list[str], ref_tokens: list[str], n: int)
phases/19-capstone-projects/71-classical-metrics/code/main.py:63
↓ 3 callers
Method
_paper_full
(self)
phases/19-capstone-projects/54-paper-writer/code/tests/test_paper_writer.py:124
↓ 3 callers
Function
_path
(prefix: str, segment: str | int)
phases/19-capstone-projects/21-tool-registry-schema-validation/code/main.py:154
↓ 3 callers
Function
_positive_int
(value: str, *, minimum: int = 1)
phases/10-llms-from-scratch/25-speculative-decoding/code/main.py:172
↓ 3 callers
Method
_require_origin
(self)
phases/13-tools-and-protocols/09-mcp-transports/code/main.py:82
↓ 3 callers
Method
_sigmoid
(self, z)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:191
↓ 3 callers
Function
_stack_images
(samples: list[torch.Tensor])
phases/19-capstone-projects/63-multimodal-eval/code/main.py:209
↓ 3 callers
Function
_summarize
(plan: list[Step])
phases/19-capstone-projects/24-plan-execute-control-flow/code/main.py:194
↓ 3 callers
Method
_token_for
(self, kind: str, value: str)
phases/17-infrastructure-and-production/25-security-secrets-audit/code/main.py:27
↓ 3 callers
Function
_trigrams
(text: str)
phases/19-capstone-projects/82-jailbreak-taxonomy/code/main.py:49
↓ 3 callers
Function
_updateActive
(items)
site/cmdpalette.js:480
↓ 3 callers
Function
_variance
(values)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:54
↓ 3 callers
Function
_walk
(schema: dict, value: Any, path: str, errs: list[ValidationError])
phases/19-capstone-projects/21-tool-registry-schema-validation/code/main.py:170
↓ 3 callers
Method
_write
(self, obj: dict)
phases/19-capstone-projects/22-jsonrpc-stdio-transport/code/main.py:131
↓ 3 callers
Function
_write_raw
(transport: StdioTransport, obj: Any)
phases/19-capstone-projects/22-jsonrpc-stdio-transport/code/main.py:180
↓ 3 callers
Function
abs_rel_error
(pred, target, mask=None)
phases/04-computer-vision/26-monocular-depth/code/main.py:8
↓ 3 callers
Function
accuracy
(y_true, y_pred)
phases/02-ml-fundamentals/09-model-evaluation/code/evaluation.py:107
↓ 3 callers
Function
actFill
(a)
site/figures-dl.js:80
↓ 3 callers
Function
add
(a, b)
phases/08-generative-ai/10-video-generation/code/main.py:27
↓ 3 callers
Function
add
(a, b)
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:28
↓ 3 callers
Function
add
(a, b)
phases/08-generative-ai/13-flow-matching-rectified-flows/code/main.py:17
↓ 3 callers
Function
add
(a, b)
phases/08-generative-ai/09-inpainting-outpainting-editing/code/main.py:27
↓ 3 callers
Function
add
(a, b)
phases/08-generative-ai/07-latent-diffusion-stable-diffusion/code/main.py:33
↓ 3 callers
Method
add
(self, c: Candidate)
phases/19-capstone-projects/66-reranker-cross-encoder/code/main.py:200
↓ 3 callers
Method
add
(chunk: Chunk)
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/index_store.ts:82
↓ 3 callers
Method
addStep
(name: string, run: (input: I) => Promise<O> | O)
phases/14-agent-engineering/18-agno-and-mastra-runtimes/code/main.ts:134
↓ 3 callers
Method
add_content
(self, span: Span, key: str, content: str)
phases/14-agent-engineering/23-otel-genai-conventions/code/main.py:66
↓ 3 callers
Method
add_server
(self, name: str, fn: Callable)
phases/13-tools-and-protocols/08-building-an-mcp-client/code/main.py:91
↓ 3 callers
Method
adjacency_matrix
(self)
phases/01-math-foundations/21-graph-theory/code/graph_theory.py:25
↓ 3 callers
Function
aggregate
(results: Sequence[EvalResult], weights: Optional[Dict[str, float]] = None)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:657
↓ 3 callers
Method
angle_between
(self, other)
phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py:28
↓ 3 callers
Function
answer_relevance
(question: str, answer: str, judge: MockJudge)
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:158
↓ 3 callers
Method
applicable
(self, state: set[str])
phases/14-agent-engineering/11-planning-htn-and-evolutionary/code/main.py:41
↓ 3 callers
Function
apply_negation
(tokens)
phases/05-nlp-foundations-to-advanced/05-sentiment-analysis/code/main.py:16
↓ 3 callers
Function
arrow
(x1, y1, x2, y2, color, dash)
site/figures-transformers.js:201
↓ 3 callers
Function
arrow
(x1, y1, x2, y2, dash)
site/figures-frontier.js:23
↓ 3 callers
Function
arrowDefs
()
site/figures-agents-alignment.js:11
↓ 3 callers
Function
atomic_save
(payload: Dict[str, Any], path: Path)
phases/19-capstone-projects/47-checkpoint-save-resume/code/main.py:109
↓ 3 callers
Function
attention
Returns (weights, output).
phases/10-llms-from-scratch/17-native-sparse-attention/code/main.py:32
↓ 3 callers
Function
attention_full
Single-query attention against full lists of keys and values.
phases/07-transformers-deep-dive/12-kv-cache-flash-attention/code/main.py:24
↓ 3 callers
Function
attention_row
(q, Ks, Vs, mask_row)
phases/07-transformers-deep-dive/15-attention-variants/code/main.py:61
↓ 3 callers
Method
authorize
(self, scopes: set[str], resource: str, user: str)
phases/13-tools-and-protocols/18-mcp-auth-production/code/main.py:311
↓ 3 callers
Method
average_score
(self)
phases/11-llm-engineering/10-evaluation/code/eval_framework.py:44
↓ 3 callers
Function
backdoor_rate
Fraction of triggered examples where the model emits the DEFECT label (mismatch from the natural label).
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:107
↓ 3 callers
Method
backward
(self, grad)
phases/03-deep-learning-core/10-mini-framework/code/main.py:220
↓ 3 callers
Method
backward
(self)
phases/03-deep-learning-core/10-mini-framework/code/main.py:271
↓ 3 callers
Function
bad_fixture_tasks
()
phases/19-capstone-projects/70-task-spec-format/code/main.py:361
↓ 3 callers
Function
bag
(tokens)
phases/09-reinforcement-learning/09-reward-modeling-rlhf/code/main.py:12
↓ 3 callers
Function
bernoulli_pmf
(k, p)
phases/01-math-foundations/06-probability-and-distributions/code/probability.py:22
↓ 3 callers
Function
block_mean
(xs, block)
phases/09-reinforcement-learning/12-rl-for-games/code/main.py:115
↓ 3 callers
Method
blocks_needed
(self)
phases/17-infrastructure-and-production/04-vllm-serving-internals/code/main.py:50
↓ 3 callers
Function
bootstrap_confidence_interval
(scores, n_bootstrap=1000, confidence=0.95)
phases/11-llm-engineering/10-evaluation/code/eval_framework.py:195
↓ 3 callers
Function
box
(x, y, w, h, label, on)
site/figures-frontier.js:17
↓ 3 callers
Function
box
(x, y, w, h, label, sub, active)
site/figures-llms2.js:128
↓ 3 callers
Function
box_iou
(boxes_a, boxes_b)
phases/04-computer-vision/06-object-detection-yolo/code/main.py:11
↓ 3 callers
Function
bubble_dualpipe
DualPipe injects micro-batches from both ends of the pipeline. Stable phase bubble is zero. Warmup/cooldown has fixed bubble independent of M.
phases/10-llms-from-scratch/19-dualpipe-parallelism/code/main.py:48
↓ 3 callers
Function
buildApp
()
phases/19-capstone-projects/04-multimodal-document-qa/code/ts/src/server.ts:6
↓ 3 callers
Function
build_default_chain
Wire the canonical four-gate chain in the order documented in en.md.
phases/19-capstone-projects/25-verification-gates-observation-budget/code/main.py:411
↓ 3 callers
Function
build_fixture
()
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:336
↓ 3 callers
Function
build_index
(prune: bool = True)
phases/19-capstone-projects/04-multimodal-document-qa/code/main.py:122
↓ 3 callers
Function
build_pipeline
()
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:663
↓ 3 callers
Function
build_prompt
(language, task="transcribe", timestamps=False)
phases/06-speech-and-audio/05-whisper-architecture-finetuning/code/main.py:26
↓ 3 callers
Function
build_toy_model
Tiny linear model with a fixed batch for the demo.
phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py:372
↓ 3 callers
Method
by_session
(self)
phases/14-agent-engineering/24-agent-observability-platforms/code/main.py:39
↓ 3 callers
Function
calc_loss_batch
Forward, flatten across batch and time, return scalar cross entropy.
phases/19-capstone-projects/36-training-loop-eval/code/main.py:209
↓ 3 callers
Method
call_with_step_up
(self, tool: str, resource_server: ResourceServer, auth_server: AuthorizationServer)
phases/13-tools-and-protocols/16-mcp-security-oauth-2-1/code/main.py:125
↓ 3 callers
Method
canonical
Rough semantic clustering: lowercase + strip whitespace/punct.
phases/16-multi-agent-and-swarms/14-consensus-and-bft/code/main.py:20
↓ 3 callers
Function
char_ngrams
(word, n_min=3, n_max=6)
phases/05-nlp-foundations-to-advanced/04-glove-fasttext-subword/code/main.py:4
← previous
next →
1,001–1,100 of 8,347, ranked by callers