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
↓ 20 callers
Method
validate
(self, name: str, args: Any)
phases/19-capstone-projects/21-tool-registry-schema-validation/code/main.py:102
↓ 19 callers
Method
add_edge
(self, u, v, weight=1.0)
phases/01-math-foundations/21-graph-theory/code/graph_theory.py:11
↓ 19 callers
Method
head
(self)
phases/15-autonomous-systems/06-automated-alignment-research/code/main.py:34
↓ 19 callers
Method
load_state_dict
(self, state: dict)
phases/19-capstone-projects/81-end-to-end-distributed-train/code/main.py:209
↓ 19 callers
Function
px
(x)
site/figures-ml.js:24
↓ 19 callers
Function
py
(y)
site/figures-math.js:153
↓ 18 callers
Method
decode
(self, ids: Iterable[int])
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:98
↓ 18 callers
Method
expand
Return a mapping of paper id to shortest hop distance from any seed.
phases/19-capstone-projects/51-literature-retrieval/code/main.py:126
↓ 18 callers
Function
f
(point)
phases/01-math-foundations/04-calculus-for-ml/code/derivatives.py:70
↓ 18 callers
Function
generate_normal
(n, mu=0, sigma=1)
phases/01-math-foundations/15-statistics-for-ml/code/statistics.py:315
↓ 18 callers
Function
px
(x)
site/lesson-figures.js:155
↓ 18 callers
Function
py
(v)
site/figures-llms2.js:24
↓ 18 callers
Function
res
(seed: int, metric_name: str, value: float, terminal: str = "ok")
phases/19-capstone-projects/53-result-evaluator/code/tests/test_evaluator.py:29
↓ 18 callers
Method
run
(self, goal: str)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:214
↓ 18 callers
Function
sequence_log_prob
Sum of log-probabilities of the completion tokens conditioned on prompt. Returns a 0-dim tensor on the same device as the model. Implementat
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:195
↓ 17 callers
Function
px
(x)
site/figures-math.js:152
↓ 17 callers
Method
zero_grad
(self)
phases/03-deep-learning-core/10-mini-framework/code/main.py:293
↓ 16 callers
Method
forward
(self, token_ids)
phases/10-llms-from-scratch/07-rlhf/code/main.py:65
↓ 16 callers
Method
post
(self, m: Msg)
phases/19-capstone-projects/10-multi-agent-software-team/code/main.py:50
↓ 16 callers
Method
text
(self)
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:172
↓ 15 callers
Function
_print_outcome
(label: str, result: SandboxResult)
phases/19-capstone-projects/26-sandbox-runner-denylist/code/main.py:412
↓ 15 callers
Method
decode
(self, tokens)
phases/10-llms-from-scratch/01-tokenizers/code/bpe.py:51
↓ 15 callers
Method
fetch
(self, paper_id: str)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:190
↓ 15 callers
Method
get
(id: string)
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/session.ts:34
↓ 15 callers
Method
get
(self, name: str)
phases/19-capstone-projects/21-tool-registry-schema-validation/code/main.py:94
↓ 15 callers
Method
get
(self, query)
phases/11-llm-engineering/13-production-app/code/production_app.py:201
↓ 15 callers
Method
lr
(self, step: int)
phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py:68
↓ 15 callers
Method
normalize
(self)
phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py:21
↓ 15 callers
Function
randn
(rows, cols, rng, scale=None)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:36
↓ 15 callers
Method
register
(self, actor: Actor)
phases/14-agent-engineering/14-autogen-actor-model/code/main.py:41
↓ 15 callers
Method
relu
(self)
phases/01-math-foundations/05-chain-rule-and-autodiff/code/autodiff.py:58
↓ 15 callers
Method
to_list
(self)
phases/01-math-foundations/12-tensor-operations/code/tensors.py:230
↓ 14 callers
Method
all
(self)
phases/19-capstone-projects/82-jailbreak-taxonomy/code/main.py:116
↓ 14 callers
Method
append
(self, role: str, text: str)
phases/14-agent-engineering/07-memory-virtual-context-memgpt/code/main.py:28
↓ 14 callers
Function
encode
Encode `text` to a list of token ids. When `allow_special` is True, literal special-token strings in the input are mapped to their reserved i
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:182
↓ 14 callers
Method
encode_completion
(self, completion: str)
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:52
↓ 14 callers
Function
fail
(issues: ValidationIssue[])
phases/11-llm-engineering/03-structured-outputs/code/main.ts:23
↓ 14 callers
Method
fit
(self, X, y)
phases/02-ml-fundamentals/06-knn-and-distances/code/knn.py:59
↓ 14 callers
Method
get
(self, cid: str)
phases/14-agent-engineering/23-otel-genai-conventions/code/main.py:39
↓ 14 callers
Method
predict
(self, X)
phases/02-ml-fundamentals/06-knn-and-distances/code/knn.py:63
↓ 14 callers
Function
px
(j)
site/figures-genai-rl.js:34
↓ 14 callers
Method
run
(self, state: SharedState)
phases/16-multi-agent-and-swarms/04-primitive-model/code/main.py:50
↓ 14 callers
Method
search
(self, query: str, top_k: int = 10)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:96
↓ 14 callers
Function
svgText
(x, y, str, anchor, fill, size)
site/figures-nlp2.js:19
↓ 14 callers
Function
toX
(u)
site/figures-math2.js:180
↓ 14 callers
Function
toY
(v)
site/figures-math2.js:181
↓ 14 callers
Method
transform
(self, X)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:67
↓ 13 callers
Function
_drive
Encode requests as newline-delimited JSON and run the server over them.
phases/19-capstone-projects/22-jsonrpc-stdio-transport/code/tests/test_transport.py:27
↓ 13 callers
Method
_emit
(self, etype: str, payload: dict)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:180
↓ 13 callers
Method
apply
(self, text: str, violations: list[Violation])
phases/19-capstone-projects/86-constitutional-rules-engine/code/main.py:178
↓ 13 callers
Function
box
(x, y, w, h, label, fill)
site/figures-llms-systems.js:424
↓ 13 callers
Function
dot
(a, b)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:5
↓ 13 callers
Function
euclidean_distance
(a, b)
phases/02-ml-fundamentals/07-unsupervised-learning/code/clustering.py:5
↓ 13 callers
Function
fileDiff
( path: string, recipe: Recipe, status: FileStatus = "queued", )
phases/19-capstone-projects/09-code-migration-agent/code/ts/src/migrations.ts:18
↓ 13 callers
Function
good_record
()
phases/19-capstone-projects/70-task-spec-format/code/tests/test_spec.py:27
↓ 13 callers
Method
load
(cls, tid: str)
phases/13-tools-and-protocols/13-mcp-async-tasks/code/main.py:47
↓ 13 callers
Method
process
(self, frame: Frame)
phases/14-agent-engineering/22-voice-agents-pipecat-livekit/code/main.py:36
↓ 13 callers
Function
py
(y)
site/lesson-figures.js:156
↓ 13 callers
Function
py
(v)
site/figures-genai-rl.js:35
↓ 13 callers
Function
quantization_error
(original, reconstructed)
phases/10-llms-from-scratch/11-quantization/code/main.py:137
↓ 13 callers
Function
run
(coro)
phases/19-capstone-projects/23-function-call-dispatcher/code/tests/test_dispatcher.py:22
↓ 13 callers
Function
select
(state, key, label, options)
site/lesson-figures.js:75
↓ 13 callers
Function
train
Train BPE merges on `corpus` until the vocabulary reaches `target_vocab_size`. The training loop is deterministic given the corpus. Ties on pair
phases/19-capstone-projects/30-bpe-tokenizer-from-scratch/code/main.py:104
↓ 12 callers
Method
_emit
(self, etype: str, payload: dict)
phases/19-capstone-projects/24-plan-execute-control-flow/code/main.py:115
↓ 12 callers
Function
_set_seed
(seed: int = SEED)
phases/19-capstone-projects/66-reranker-cross-encoder/code/main.py:35
↓ 12 callers
Function
accuracy
(y_true, y_pred)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:113
↓ 12 callers
Function
aggregate
( runs: Sequence[EvalRun], b: int = 500, alpha: float = 0.05, seed: int = 0, )
phases/19-capstone-projects/74-leaderboard-aggregation/code/main.py:169
↓ 12 callers
Function
compute_sequence_log_prob
(model, prompt_tokens, response_tokens, max_seq_len=128)
phases/10-llms-from-scratch/08-dpo/code/main.py:52
↓ 12 callers
Method
empty
(g, h, e)
phases/19-capstone-projects/24-plan-execute-control-flow/code/tests/test_agent.py:40
↓ 12 callers
Method
evaluate
(self, text: str)
phases/19-capstone-projects/86-constitutional-rules-engine/code/main.py:144
↓ 12 callers
Method
fire
(self, topic: str, payload: dict)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:129
↓ 12 callers
Method
fit_transform
(self, X)
phases/01-math-foundations/10-dimensionality-reduction/code/dim_reduction.py:35
↓ 12 callers
Function
handler
(method: str, params: Any)
phases/19-capstone-projects/22-jsonrpc-stdio-transport/code/main.py:220
↓ 12 callers
Function
human
(x)
site/lesson-figures.js:396
↓ 12 callers
Function
loss_fn
(params, x, y)
phases/03-deep-learning-core/12-intro-to-jax/code/jax_intro.py:48
↓ 12 callers
Function
mat_vec_mul
(matrix, vector)
phases/01-math-foundations/03-matrix-transformations/code/transformations.py:40
↓ 12 callers
Function
px
(i)
site/figures-llms2.js:23
↓ 12 callers
Method
run
(self, seed: list[Hypothesis])
phases/19-capstone-projects/56-iteration-scheduler/code/main.py:158
↓ 12 callers
Method
search
(self, query: str, k: int = 10)
phases/19-capstone-projects/65-hybrid-retrieval-bm25-dense/code/main.py:77
↓ 12 callers
Method
train
(self)
phases/03-deep-learning-core/10-mini-framework/code/main.py:18
↓ 12 callers
Method
violations
(self)
phases/19-capstone-projects/86-constitutional-rules-engine/code/main.py:52
↓ 12 callers
Function
write
(path: Path, content: str)
phases/14-agent-engineering/42-agent-workbench-capstone/code/main.py:593
↓ 11 callers
Function
build_models
Build a reference and a policy. The policy is initialised from the reference's state dict so they start in the same place, then the policy div
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:364
↓ 11 callers
Method
chunk
(self, doc_id: str, text: str)
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:134
↓ 11 callers
Function
dispatch
(state: ProtocolState, msg: JsonRpcRequest)
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/protocol.ts:56
↓ 11 callers
Method
encode_prompt
(self, prompt: str)
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:46
↓ 11 callers
Function
fft
(x)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:78
↓ 11 callers
Method
forward
(self, token_ids)
phases/10-llms-from-scratch/04-pre-training-mini-gpt/code/main.py:93
↓ 11 callers
Function
make_fake_embedding
(seed: int, dim: int = 64)
phases/12-multimodal-ai/02-clip-contrastive-pretraining/code/main.py:92
↓ 11 callers
Function
matmul
(A, B)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:45
↓ 11 callers
Method
predict
(self, X)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:92
↓ 11 callers
Method
put
(self, key: KVKey, record: Record)
phases/14-agent-engineering/09-hybrid-memory-mem0/code/main.py:60
↓ 11 callers
Method
resume
(self, payload: dict | None = None)
phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:222
↓ 11 callers
Function
run_eval
( adapters: Sequence[ModelAdapter], tasks: Sequence[TaskSpec], parallel: bool = True, max_work
phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py:137
↓ 11 callers
Method
signature
Return the MinHash signature as a list of num_hashes 64-bit ints.
phases/19-capstone-projects/42-large-corpus-downloader/code/main.py:147
↓ 11 callers
Method
size
()
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/index_store.ts:128
↓ 11 callers
Method
squeeze
(self, dim=None)
phases/01-math-foundations/12-tensor-operations/code/tensors.py:125
↓ 11 callers
Method
step
(self, params, grads)
phases/03-deep-learning-core/06-optimizers/code/main.py:9
↓ 11 callers
Function
tokenize
(text: str)
phases/19-capstone-projects/71-classical-metrics/code/main.py:23
↓ 11 callers
Function
validate_task
(record: dict, line_number: int = 0)
phases/19-capstone-projects/70-task-spec-format/code/main.py:164
← previous
next →
101–200 of 8,347, ranked by callers