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
↓ 1 callers
Function
generate_circle_data
(n=100)
phases/03-deep-learning-core/03-backpropagation/code/main.py:178
↓ 1 callers
Function
generate_constrained
(alphabet, fsm, seed)
phases/05-nlp-foundations-to-advanced/20-structured-outputs-constrained-decoding/code/main.py:59
↓ 1 callers
Function
generate_handoff
(task_id: str, session_id: str | None = None)
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/scripts/generate_handoff.py:43
↓ 1 callers
Function
generate_handoff
(snapshot: WorkbenchSnapshot)
phases/14-agent-engineering/40-multi-session-handoff/code/main.py:73
↓ 1 callers
Function
generate_high_dim_data
(n_samples=500, n_dims=2, seed=42)
phases/02-ml-fundamentals/06-knn-and-distances/code/knn.py:213
↓ 1 callers
Function
generate_initial_thoughts
(question, client, model, breadth=3)
phases/11-llm-engineering/02-few-shot-cot/code/advanced_prompting.py:213
↓ 1 callers
Function
generate_judge_reasoning
(input_text, model_output, criterion, score)
phases/11-llm-engineering/10-evaluation/code/eval_framework.py:140
↓ 1 callers
Function
generate_regression_data
(n_samples=200, seed=42)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:305
↓ 1 callers
Function
generate_regression_data
(n_samples=200, seed=42)
phases/02-ml-fundamentals/06-knn-and-distances/code/knn.py:201
↓ 1 callers
Function
generate_response
(model, prompt_tokens, max_new_tokens=50, temperature=0.8)
phases/10-llms-from-scratch/06-instruction-tuning-sft/code/main.py:172
↓ 1 callers
Function
generate_sample_corpus
()
phases/10-llms-from-scratch/03-data-pipelines/code/main.py:237
↓ 1 callers
Function
generate_signal
(n=1000, seed=0)
phases/06-speech-and-audio/13-neural-audio-codecs/code/main.py:14
↓ 1 callers
Function
generate_unconstrained
(alphabet, max_len, seed)
phases/05-nlp-foundations-to-advanced/20-structured-outputs-constrained-decoding/code/main.py:81
↓ 1 callers
Method
getFullAuditLog
()
phases/16-multi-agent-and-swarms/03-communication-protocols/code/main.ts:348
↓ 1 callers
Function
getLessonProgress
(path)
site/progress.js:99
↓ 1 callers
Method
getOrCreate
(tenant: Tenant)
phases/17-infrastructure-and-production/19-ai-gateways/code/main.ts:92
↓ 1 callers
Function
get_bucket
(user_id: str)
phases/13-tools-and-protocols/17-mcp-gateways-and-registries/code/main.py:95
↓ 1 callers
Function
get_mnist_data
()
phases/03-deep-learning-core/12-intro-to-jax/code/jax_intro.py:7
↓ 1 callers
Method
get_params
(self)
phases/03-deep-learning-core/06-optimizers/code/main.py:111
↓ 1 callers
Function
get_shingles
(text, k=5)
phases/10-llms-from-scratch/03-data-pipelines/code/main.py:30
↓ 1 callers
Method
get_stats
(self)
phases/11-llm-engineering/12-guardrails/code/guardrails.py:371
↓ 1 callers
Method
get_usage
(self, user_id)
phases/11-llm-engineering/11-caching-cost/code/caching_cost.py:216
↓ 1 callers
Function
global_grad_norm
(model: nn.Module)
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:75
↓ 1 callers
Function
gmm
(data, k, max_iterations=100, seed=42)
phases/02-ml-fundamentals/07-unsupervised-learning/code/clustering.py:162
↓ 1 callers
Function
goodput
(traces: list[RequestTrace], slo_ttft: float, slo_tpot: float, slo_e2e: float)
phases/17-infrastructure-and-production/08-inference-metrics-goodput/code/main.py:85
↓ 1 callers
Function
gpu_check
(total_gb: float)
phases/17-infrastructure-and-production/09-production-quantization/code/main.py:61
↓ 1 callers
Function
gpu_hours_recovered
(P: int, M: int, total_gpu_hours: float)
phases/10-llms-from-scratch/19-dualpipe-parallelism/code/main.py:73
↓ 1 callers
Function
grad
(t)
site/figures-genai-rl.js:358
↓ 1 callers
Function
grad_U
(x)
phases/01-math-foundations/22-stochastic-processes/code/stochastic.py:174
↓ 1 callers
Function
gradient_check
(model, x, y, criterion, eps=1e-4)
phases/03-deep-learning-core/13-debugging-neural-networks/code/debug_neural_nets.py:235
↓ 1 callers
Function
gradient_check
(build_expr, x_val, h=1e-7)
phases/01-math-foundations/05-chain-rule-and-autodiff/code/autodiff.py:229
↓ 1 callers
Function
gram_schmidt
(vectors)
phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py:68
↓ 1 callers
Function
greedy_ctc_decode
(log_probs, blank=0)
phases/04-computer-vision/19-ocr-document-understanding/code/main.py:15
↓ 1 callers
Function
greedy_policy
(theta)
phases/09-reinforcement-learning/06-policy-gradients-reinforce/code/main.py:104
↓ 1 callers
Function
greedy_policy
(theta)
phases/09-reinforcement-learning/07-actor-critic-a2c-a3c/code/main.py:138
↓ 1 callers
Function
greedy_policy
(theta)
phases/09-reinforcement-learning/08-ppo/code/main.py:162
↓ 1 callers
Function
ground_window
Stand-in: pick a sub-window of the scene based on query keyword position.
phases/19-capstone-projects/12-video-understanding-pipeline/code/main.py:115
↓ 1 callers
Function
grounded_generate
(query: str, ranked: list[tuple[str, float]])
phases/12-multimodal-ai/24-multimodal-rag-cross-modal/code/main.py:89
↓ 1 callers
Function
grouped_query_attention
Same as MHA but K and V have fewer heads, repeated to match Q.
phases/07-transformers-deep-dive/03-multi-head-attention/code/main.py:133
↓ 1 callers
Function
grpo_step
(theta, reference, rng, G=8, beta=0.01, lr=0.1)
phases/09-reinforcement-learning/12-rl-for-games/code/main.py:39
↓ 1 callers
Function
grpo_step
( policy_logprobs: np.ndarray, ref_logprobs: np.ndarray, advantages: np.ndarray, beta: float =
phases/10-llms-from-scratch/09-constitutional-ai-self-improvement/code/main.py:106
↓ 1 callers
Function
gumbel_max_sample
(log_probs)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:331
↓ 1 callers
Function
gumbel_softmax_straight_through
(log_probs, temperature)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:342
↓ 1 callers
Function
hammingDistance
(a: Uint8Array, b: Uint8Array)
phases/11-llm-engineering/04-embeddings/code/main.ts:138
↓ 1 callers
Function
hamming_distance
(a, b)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:90
↓ 1 callers
Function
hamming_window
(N)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:125
↓ 1 callers
Method
handle
(self, rng: random.Random)
phases/16-multi-agent-and-swarms/23-failure-modes-mast-groupthink/code/main.py:108
↓ 1 callers
Method
handle
(self, message: dict[str, Any])
phases/11-llm-engineering/14-model-context-protocol/code/main.py:79
↓ 1 callers
Function
handleInitialize
()
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/protocol.ts:25
↓ 1 callers
Function
handleShutdown
(state: ProtocolState)
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/protocol.ts:51
↓ 1 callers
Function
handleToolsCall
(state: ProtocolState, params: Record<string, unknown>)
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/protocol.ts:37
↓ 1 callers
Function
handleToolsList
(state: ProtocolState)
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/protocol.ts:33
↓ 1 callers
Method
handle_streaming_request
(self, user_id, query, template_name="general_chat")
phases/11-llm-engineering/13-production-app/code/production_app.py:525
↓ 1 callers
Function
hann
(N)
phases/06-speech-and-audio/03-audio-classification/code/main.py:23
↓ 1 callers
Function
hann
(N)
phases/06-speech-and-audio/06-speaker-recognition-verification/code/main.py:28
↓ 1 callers
Function
hann_window
(N)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:121
↓ 1 callers
Function
hardcoded_block
(action: str)
phases/15-autonomous-systems/17-constitutional-ai/code/main.py:42
↓ 1 callers
Method
has
(self, h: str)
phases/10-llms-from-scratch/13-building-complete-llm-pipeline/code/main.py:84
↓ 1 callers
Function
has_diffusers
()
phases/04-computer-vision/11-stable-diffusion/code/main.py:10
↓ 1 callers
Method
has_scope
(self, s: str)
phases/19-capstone-projects/13-mcp-server-with-registry/code/main.py:74
↓ 1 callers
Function
hash_description
(desc: str)
phases/13-tools-and-protocols/15-mcp-security-tool-poisoning/code/main.py:57
↓ 1 callers
Function
hbm_footprint_gb
(params_b: float, active_b: float, seq_len: int, stack: Stack)
phases/17-infrastructure-and-production/07-tensorrt-llm-blackwell/code/main.py:40
↓ 1 callers
Method
health_check
(self)
phases/11-llm-engineering/13-production-app/code/production_app.py:574
↓ 1 callers
Function
hessian_f
(x)
phases/01-math-foundations/18-convex-optimization/code/convex.py:220
↓ 1 callers
Function
hinge_loss
(X, y, w, b)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:38
↓ 1 callers
Function
histogram
(samples, lo=-5.0, hi=5.0, bins=30)
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:142
↓ 1 callers
Function
histogram
(samples, lo=-5.0, hi=5.0, bins=30)
phases/08-generative-ai/13-flow-matching-rectified-flows/code/main.py:110
↓ 1 callers
Method
histogram
(self, name: str)
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:392
↓ 1 callers
Function
histogram_density
Explicit density via histogram. Returns p(x) as (count in bin) / (n * bin_width).
phases/08-generative-ai/01-generative-models-taxonomy-history/code/main.py:16
↓ 1 callers
Method
history
(sessionId: string)
phases/14-agent-engineering/18-agno-and-mastra-runtimes/code/main.ts:42
↓ 1 callers
Method
history
(self, session_id: str)
phases/14-agent-engineering/18-agno-and-mastra-runtimes/code/main.py:28
↓ 1 callers
Method
history
(sessionId: string)
phases/14-agent-engineering/13-langgraph-stateful-graphs/code/main.ts:83
↓ 1 callers
Method
history
(self, session_id: str)
phases/14-agent-engineering/13-langgraph-stateful-graphs/code/main.py:80
↓ 1 callers
Method
hit_rate
(self)
phases/19-capstone-projects/08-production-rag-chatbot/code/main.py:145
↓ 1 callers
Method
hit_rate
(self)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:233
↓ 1 callers
Function
horizon_at
Project the 50% horizon at a given month offset.
phases/15-autonomous-systems/01-long-horizon-agents/code/main.py:25
↓ 1 callers
Function
horizon_projection
Plot the horizon forward using METR's fit slope.
phases/15-autonomous-systems/01-long-horizon-agents/code/main.py:57
↓ 1 callers
Function
htn_demo
()
phases/14-agent-engineering/11-planning-htn-and-evolutionary/code/main.py:104
↓ 1 callers
Function
hwc_to_chw
(arr)
phases/04-computer-vision/01-image-fundamentals/code/main.py:42
↓ 1 callers
Function
hybrid_pipeline
Lexical baseline plus a synonym pass; stand-in for the lesson 65 retriever.
phases/19-capstone-projects/68-rag-eval-precision-recall/code/main.py:303
↓ 1 callers
Function
hybrid_respond
(user_input)
phases/05-nlp-foundations-to-advanced/17-chatbots-rule-to-neural/code/main.py:62
↓ 1 callers
Function
hyde_generate_hypothesis
(query)
phases/11-llm-engineering/07-advanced-rag/code/main.py:173
↓ 1 callers
Function
hyde_search
(query, vector_embeddings, vocab, idf, top_k=5)
phases/11-llm-engineering/07-advanced-rag/code/main.py:195
↓ 1 callers
Method
identity
(n)
phases/01-math-foundations/02-vectors-matrices-operations/code/matrices.py:147
↓ 1 callers
Method
idf
(self, term)
phases/05-nlp-foundations-to-advanced/14-information-retrieval-search/code/main.py:24
↓ 1 callers
Method
idf
(self, term: str)
phases/19-capstone-projects/51-literature-retrieval/code/main.py:77
↓ 1 callers
Function
idft
(spectrum)
phases/01-math-foundations/19-complex-numbers/code/complex_numbers.py:96
↓ 1 callers
Function
im2col
(x, kh, kw, stride=1, padding=0)
phases/04-computer-vision/02-convolutions-from-scratch/code/main.py:39
↓ 1 callers
Function
implicit_generator
Implicit generator: sample a training point and add tiny noise. No p(x).
phases/08-generative-ai/01-generative-models-taxonomy-history/code/main.py:34
↓ 1 callers
Function
importance_sampling_demo
()
phases/01-math-foundations/16-sampling-methods/code/sampling.py:99
↓ 1 callers
Function
importance_sampling_estimate
(f, target_pdf, proposal_pdf, proposal_sample, n)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:86
↓ 1 callers
Function
impute_mean
(values)
phases/02-ml-fundamentals/08-feature-engineering/code/features.py:146
↓ 1 callers
Function
impute_median
(values)
phases/02-ml-fundamentals/08-feature-engineering/code/features.py:154
↓ 1 callers
Method
inc
(self, labels: dict[str, str])
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:348
↓ 1 callers
Function
independent_per_frame
Baseline: sample each frame independently from a random walk.
phases/08-generative-ai/10-video-generation/code/main.py:164
↓ 1 callers
Function
independent_q
(episodes=1500, alpha=0.1, gamma=0.95, epsilon=0.15, rng=None)
phases/09-reinforcement-learning/10-multi-agent-rl/code/main.py:41
↓ 1 callers
Method
index
(self, documents)
phases/11-llm-engineering/07-advanced-rag/code/main.py:75
↓ 1 callers
Method
indexDocuments
(docs: readonly Doc[])
phases/11-llm-engineering/04-embeddings/code/main.ts:192
↓ 1 callers
Function
infer_gender
(name)
phases/05-nlp-foundations-to-advanced/24-coreference-resolution/code/main.py:62
↓ 1 callers
Function
inflate_2d_to_3d
(conv2d, time_kernel=3)
phases/04-computer-vision/12-video-understanding/code/main.py:42
← previous
next →
3,801–3,900 of 8,347, ranked by callers