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
Method
predict
(self, X)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:253
↓ 4 callers
Method
predict
(self, X)
phases/02-ml-fundamentals/11-ensemble-methods/code/ensembles.py:155
↓ 4 callers
Function
pretty
(msg: AnyMessage)
phases/11-llm-engineering/16-langgraph-state-machines/code/main.py:108
↓ 4 callers
Function
print_feature_scores
(names, scores, label, top_k=None)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:245
↓ 4 callers
Function
print_report
(name: str, cfg: dict, ctx: int | None = None)
phases/10-llms-from-scratch/20-deepseek-v3-walkthrough/code/main.py:212
↓ 4 callers
Function
print_report
(name: str, stats: ProviderStats, baseline: float, n: int)
phases/11-llm-engineering/15-prompt-caching/code/main.py:137
↓ 4 callers
Method
print_report
(self)
phases/03-deep-learning-core/13-debugging-neural-networks/code/debug_neural_nets.py:109
↓ 4 callers
Function
print_scenario
(params_b: float, concurrency: int, ctx: int)
phases/17-infrastructure-and-production/09-production-quantization/code/main.py:71
↓ 4 callers
Function
print_stack
(params_b: float, active_b: float, seq_len: int = 8192)
phases/17-infrastructure-and-production/07-tensorrt-llm-blackwell/code/main.py:66
↓ 4 callers
Method
process
(self, input_stream: list, kind: str)
phases/12-multimodal-ai/15-janus-pro-decoupled-encoders/code/main.py:42
↓ 4 callers
Method
process
(userInput: string, modelFn?: ModelFn)
phases/11-llm-engineering/12-guardrails/code/main.ts:295
↓ 4 callers
Method
prompt_signature
(prompt: str)
phases/19-capstone-projects/50-hypothesis-generator/code/main.py:133
↓ 4 callers
Function
py
(v)
site/figures-frontier.js:253
↓ 4 callers
Function
quick_generate
(model: GPTModel, prompt: torch.Tensor, n: int, seed: int = 0)
phases/19-capstone-projects/37-loading-pretrained-weights/code/main.py:328
↓ 4 callers
Function
random_leaf
()
phases/15-autonomous-systems/03-alphaevolve-evolutionary-coding/code/main.py:82
↓ 4 callers
Function
recall
(y_true, y_pred)
phases/02-ml-fundamentals/09-model-evaluation/code/evaluation.py:118
↓ 4 callers
Function
recall_at_k
(retrieved: list[str], gold: set[str], k: int)
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:48
↓ 4 callers
Method
receive
(self, message: Message, runtime: "Runtime")
phases/14-agent-engineering/14-autogen-actor-model/code/main.py:28
↓ 4 callers
Function
reciprocal_rank
(retrieved: list[str], gold: set[str])
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:55
↓ 4 callers
Method
record_loss
(self, loss_value)
phases/03-deep-learning-core/13-debugging-neural-networks/code/debug_neural_nets.py:50
↓ 4 callers
Function
redact
Presidio-style redaction stand-in: email, SSN, phone.
phases/19-capstone-projects/13-mcp-server-with-registry/code/main.py:104
↓ 4 callers
Method
register
(self, schema: ToolSchema, handler: Handler)
phases/19-capstone-projects/13-mcp-server-with-registry/code/main.py:44
↓ 4 callers
Method
remove_hooks
(self)
phases/03-deep-learning-core/13-debugging-neural-networks/code/debug_neural_nets.py:134
↓ 4 callers
Function
render
(gaussians)
phases/08-generative-ai/12-3d-generation/code/main.py:34
↓ 4 callers
Function
renderDocument
(doc: DocumentFixture)
phases/19-capstone-projects/04-multimodal-document-qa/code/ts/src/render.ts:30
↓ 4 callers
Function
render_report
( adapters: Sequence[ModelAdapter], tasks: Sequence[TaskSpec], results: Sequence[TaskResult],
phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py:223
↓ 4 callers
Function
report
(label: str, res: dict)
phases/17-infrastructure-and-production/06-sglang-radixattention/code/main.py:146
↓ 4 callers
Function
report
(label: str, reqs: list[Request], sim_end: float)
phases/17-infrastructure-and-production/04-vllm-serving-internals/code/main.py:67
↓ 4 callers
Function
request
(mid: int, method: str, params: dict | None = None)
phases/13-tools-and-protocols/06-mcp-fundamentals/code/main.py:35
↓ 4 callers
Function
reset
()
phases/09-reinforcement-learning/10-multi-agent-rl/code/main.py:17
↓ 4 callers
Function
rolledUpStats
(migrations: Migration[])
phases/19-capstone-projects/09-code-migration-agent/code/ts/src/migrations.ts:127
↓ 4 callers
Function
rosenbrock
(params)
phases/01-math-foundations/08-optimization/code/optimizers.py:4
↓ 4 callers
Method
rotation
()
phases/19-capstone-projects/10-multi-agent-software-team/code/ts/src/coordinator.ts:26
↓ 4 callers
Function
rotation_2d
(theta)
phases/01-math-foundations/03-matrix-transformations/code/transformations.py:4
↓ 4 callers
Function
route
(alias: str, messages: list[dict])
phases/13-tools-and-protocols/21-llm-routing-layer/code/main.py:82
↓ 4 callers
Function
rrf
( dense: RankedChunk[], sparse: RankedChunk[], kRrf = 60, )
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/retrieval.ts:6
↓ 4 callers
Method
run
(self, question: str)
phases/16-multi-agent-and-swarms/06-hierarchical-architecture/code/main.py:38
↓ 4 callers
Method
run
(userMessage: string, calls: ToolCall[])
phases/14-agent-engineering/18-agno-and-mastra-runtimes/code/main.ts:100
↓ 4 callers
Method
run
(self, agent: Agent, user_input: str)
phases/14-agent-engineering/16-openai-agents-sdk/code/main.py:72
↓ 4 callers
Function
runAgent
(task: string, sandbox: string)
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/harness.ts:7
↓ 4 callers
Function
run_agent
(actions: list[Action], screen: Screen, classifier: SafetyClassifier, human_confir
phases/14-agent-engineering/21-computer-use-agents/code/main.py:92
↓ 4 callers
Function
run_tests
Deterministic stub: simulate the test suite against the repo string.
phases/15-autonomous-systems/09-coding-agent-landscape/code/main.py:44
↓ 4 callers
Function
run_zero
(world_size: int = WORLD_SIZE, steps: int = STEPS, batch: int = BATCH, lr: float = 0.05)
phases/19-capstone-projects/78-zero-parameter-sharding/code/main.py:208
↓ 4 callers
Method
sample
(self)
phases/18-ethics-safety-alignment/01-instruction-following-alignment-signal/code/main.py:41
↓ 4 callers
Function
sample_from_probs
(probs)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:216
↓ 4 callers
Function
sample_noise
(n, z_dim, rng)
phases/08-generative-ai/03-gans-generator-discriminator/code/main.py:66
↓ 4 callers
Method
save
(self, k: str, v: dict)
phases/15-autonomous-systems/16-checkpoints-rollback/code/main.py:53
↓ 4 callers
Function
scaling_2d
(sx, sy)
phases/01-math-foundations/03-matrix-transformations/code/transformations.py:24
↓ 4 callers
Function
scenario
(name: str, correct: str, votes: list[Vote])
phases/16-multi-agent-and-swarms/14-consensus-and-bft/code/main.py:72
↓ 4 callers
Method
schedule
(self)
phases/19-capstone-projects/50-hypothesis-generator/code/main.py:156
↓ 4 callers
Function
score
(w, tokens)
phases/09-reinforcement-learning/09-reward-modeling-rlhf/code/main.py:23
↓ 4 callers
Method
score
(self, X, y)
phases/02-ml-fundamentals/14-naive-bayes/code/naive_bayes.py:99
↓ 4 callers
Method
search
(self, query: str, k: int)
phases/19-capstone-projects/67-query-rewriting-hyde/code/main.py:89
↓ 4 callers
Method
search
(query: string, k = 10)
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/index_store.ts:105
↓ 4 callers
Function
seedFixture
(store: JobStore)
phases/19-capstone-projects/12-video-understanding-pipeline/code/ts/src/jobs.ts:78
↓ 4 callers
Function
seed_everything
(seed: int)
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:55
↓ 4 callers
Function
semantic_chunks
(doc_id: str, text: str, similarity_threshold: float = 0.55, max_chars: int = 900)
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:180
↓ 4 callers
Method
send
(self, sender: str, recipient: str, topic: str, body: Any)
phases/14-agent-engineering/14-autogen-actor-model/code/main.py:44
↓ 4 callers
Method
set
(self, i: int, j: int, v: float)
phases/07-transformers-deep-dive/03-multi-head-attention/code/main.py:29
↓ 4 callers
Function
setBar
(selector, pct)
site/app.js:74
↓ 4 callers
Function
shifted_loss
Standard causal LM loss: predict next token, ignore the masked positions.
phases/19-capstone-projects/39-instruction-tuning-sft/code/main.py:432
↓ 4 callers
Function
signal_of
(c: Candidate)
phases/15-autonomous-systems/03-alphaevolve-evolutionary-coding/code/main.py:139
↓ 4 callers
Function
signedHeaders
(body: string, opts: SignedOpts = {})
phases/19-capstone-projects/06-devops-troubleshooting-agent/code/ts/src/index.ts:45
↓ 4 callers
Function
simulate
(n: int, harm_aversion: float, preservation_weight: float)
phases/18-ethics-safety-alignment/09-alignment-faking/code/main.py:51
↓ 4 callers
Function
simulate
(requests: list[Request], scheduler: str)
phases/17-infrastructure-and-production/06-sglang-radixattention/code/main.py:87
↓ 4 callers
Method
size
()
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/session.ts:30
↓ 4 callers
Function
snr
(weights_row: List[float], signal_pos: int)
phases/10-llms-from-scratch/16-differential-attention-v2/code/main.py:113
↓ 4 callers
Function
softmax
(logits)
phases/03-deep-learning-core/05-loss-functions/code/main.py:43
↓ 4 callers
Function
softmax
(logits)
phases/01-math-foundations/09-information-theory/code/information_theory.py:50
↓ 4 callers
Function
softmax_naive
(logits)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:6
↓ 4 callers
Function
standardize
(X)
phases/02-ml-fundamentals/06-knn-and-distances/code/knn.py:28
↓ 4 callers
Method
start_span
(self, name: str, kind: str = "INTERNAL", attributes: dict[str, Any] | None = None)
phases/14-agent-engineering/23-otel-genai-conventions/code/main.py:54
↓ 4 callers
Function
step
(state, action_pair)
phases/09-reinforcement-learning/10-multi-agent-rl/code/main.py:21
↓ 4 callers
Method
step
Run one training step with optional gradient corruption for testing. `gradient_corruptor` lets the demo inject a non-finite gradient after
phases/19-capstone-projects/45-gradient-clipping-amp/code/main.py:193
↓ 4 callers
Function
swiglu_mlp_params
(hidden: int, ff: int)
phases/10-llms-from-scratch/20-deepseek-v3-walkthrough/code/main.py:72
↓ 4 callers
Function
sync
()
phases/04-computer-vision/16-vision-pipeline-capstone/code/main.py:157
↓ 4 callers
Function
synth_memory
(batch: int, n_tokens: int, dim: int, seed: int)
phases/19-capstone-projects/61-cross-attention-fusion/code/main.py:205
↓ 4 callers
Function
t
(s)
site/figures-vision-speech.js:210
↓ 4 callers
Method
take
(self, num_batches: int)
phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:370
↓ 4 callers
Function
thru
(b)
site/figures-infra.js:276
↓ 4 callers
Method
to_dict
(self)
phases/19-capstone-projects/50-hypothesis-generator/code/main.py:44
↓ 4 callers
Method
to_dict
(self)
phases/19-capstone-projects/70-task-spec-format/code/main.py:76
↓ 4 callers
Method
to_dict
(self)
phases/19-capstone-projects/25-verification-gates-observation-budget/code/main.py:34
↓ 4 callers
Function
token_count
(seg: str)
phases/17-infrastructure-and-production/06-sglang-radixattention/code/main.py:23
↓ 4 callers
Function
tokenize
(text)
phases/05-nlp-foundations-to-advanced/14-information-retrieval-search/code/main.py:6
↓ 4 callers
Function
tokenize
(text)
phases/05-nlp-foundations-to-advanced/13-question-answering/code/main.py:5
↓ 4 callers
Function
tokenize
(s: str)
phases/19-capstone-projects/08-production-rag-chatbot/code/main.py:59
↓ 4 callers
Function
tokenizeAnswer
(query: string, citations: Citation[])
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/stream.ts:54
↓ 4 callers
Function
tokenize_for_reward
(prompt, response, vocab_size=256)
phases/10-llms-from-scratch/07-rlhf/code/main.py:80
↓ 4 callers
Function
tokenize_pair
(query: str, document: str, max_len: int = 96)
phases/19-capstone-projects/66-reranker-cross-encoder/code/main.py:51
↓ 4 callers
Function
train
(model: LogReg, data: list[Example], epochs: int)
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:119
↓ 4 callers
Function
train
(c)
site/figures-dl.js:388
↓ 4 callers
Function
train_classifier
( model: Classifier, train_loader: DataLoader, epochs: int, lr: float, seed: int, )
phases/19-capstone-projects/38-classifier-finetuning/code/main.py:386
↓ 4 callers
Function
train_dpo
( policy: TinyGPT, reference: TinyGPT, tok: InstructionTokenizer, triples: Sequence[Dict[str,
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:452
↓ 4 callers
Function
train_test_split
(X, y, test_fraction=0.3, seed=42)
phases/02-ml-fundamentals/01-what-is-machine-learning/code/ml_intro.py:38
↓ 4 callers
Function
trainable_params
(model: nn.Module)
phases/19-capstone-projects/38-classifier-finetuning/code/main.py:190
↓ 4 callers
Method
turn
(self, user_text: str, writes: list[tuple[str, str, str]])
phases/14-agent-engineering/08-memory-blocks-sleep-time-compute/code/main.py:115
↓ 4 callers
Function
turnLatencyMs
(m: Metrics)
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/orchestrator.ts:27
↓ 4 callers
Function
validate_schema
(data, schema)
phases/11-llm-engineering/03-structured-outputs/code/main.py:4
↓ 4 callers
Method
vocab_size
(self)
phases/10-llms-from-scratch/01-tokenizers/code/main.py:61
← previous
next →
901–1,000 of 8,347, ranked by callers