MCPcopy Create free account

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

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

↓ 2 callersFunctiondot_product
(a, b)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:82
↓ 2 callersFunctiondownsample
Average-pool an HxW image down to target x target.
phases/08-generative-ai/19-visual-autoregressive-var/code/main.py:88
↓ 2 callersFunctiondpo_train
( policy_model, reference_model, preference_data, num_epochs=5, lr=5e-6, beta=0.1,
phases/10-llms-from-scratch/08-dpo/code/main.py:141
↓ 2 callersFunctiondrawLine
(a, b, c, st)
site/figures-math2.js:292
↓ 2 callersFunctiondrawMergeRow
(step, justMerged)
site/figures.js:138
↓ 2 callersFunctioneig
(l)
site/figures-math.js:352
↓ 2 callersFunctioneigenvalues_2x2
(matrix)
phases/01-math-foundations/03-matrix-transformations/code/transformations.py:68
↓ 2 callersFunctioneigvec
(l)
site/figures-math.js:106
↓ 2 callersMethodelement_at
(self, x: int, y: int)
phases/14-agent-engineering/21-computer-use-agents/code/main.py:30
↓ 2 callersFunctionelicit
Simulates elicitation/create round trip.
phases/13-tools-and-protocols/12-mcp-roots-and-elicitation/code/main.py:51
↓ 2 callersFunctionembed
(text: string)
phases/17-infrastructure-and-production/14-prompt-semantic-caching/code/main.ts:89
↓ 2 callersFunctionemit_notification
(method: str, params: dict)
phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py:34
↓ 2 callersFunctionempirical_dist
(samples: list[int], vocab: int)
phases/10-llms-from-scratch/25-speculative-decoding/code/main.py:85
↓ 2 callersMethodempirical_distribution
(self, states)
phases/01-math-foundations/22-stochastic-processes/code/stochastic.py:56
↓ 2 callersFunctionencode
Snap each value to the nearest code; return integer tokens.
phases/08-generative-ai/19-visual-autoregressive-var/code/main.py:82
↓ 2 callersMethodencode
(self, image_seed: int)
phases/12-multimodal-ai/15-janus-pro-decoupled-encoders/code/main.py:20
↓ 2 callersMethodencode
(self, image_seed: int)
phases/12-multimodal-ai/15-janus-pro-decoupled-encoders/code/main.py:30
↓ 2 callersMethodencode_image
(self, x)
phases/04-computer-vision/18-open-vocab-clip/code/main.py:13
↓ 2 callersMethodencode_text
(self, x)
phases/04-computer-vision/18-open-vocab-clip/code/main.py:16
↓ 2 callersMethodencode_text
(self, text: str, max_len: int)
phases/19-capstone-projects/41-eval-pipeline/code/main.py:63
↓ 2 callersMethodendSpan
(span: Span, status: SpanStatus = "OK")
phases/17-infrastructure-and-production/13-llm-observability/code/main.ts:90
↓ 2 callersMethodenqueue
(self, msg: dict)
phases/16-multi-agent-and-swarms/22-production-scaling-queues-checkpoints/code/main.py:87
↓ 2 callersFunctionentropy
(counts)
phases/07-transformers-deep-dive/11-mixture-of-experts/code/main.py:84
↓ 2 callersFunctionentropy
(labels)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:15
↓ 2 callersFunctionepsilon_greedy
(Q, s, rng, eps)
phases/09-reinforcement-learning/11-sim-to-real-transfer/code/main.py:28
↓ 2 callersFunctionerror_vs_truth
(agents: list[DebateAgent])
phases/16-multi-agent-and-swarms/07-society-of-mind-debate/code/main.py:46
↓ 2 callersMethodestCost
(model: Model, promptTokens: number, outputTokens = 200)
phases/17-infrastructure-and-production/16-model-routing/code/main.ts:132
↓ 2 callersFunctioneuclideanDistance
(a: Vec, b: Vec)
phases/11-llm-engineering/04-embeddings/code/main.ts:122
↓ 2 callersFunctioneuclidean_distance
(a, b)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:86
↓ 2 callersFunctionevaluate
Run the toy WMDP-shaped benchmark. Returns per-domain score.
phases/18-ethics-safety-alignment/17-wmdp-dual-use-evaluation/code/main.py:27
↓ 2 callersFunctionevaluate
(model_fn, n: int = 200)
phases/18-ethics-safety-alignment/05-constitutional-ai-rlaif/code/main.py:124
↓ 2 callersFunctionevaluate
(theta, episodes=200, rng=None)
phases/09-reinforcement-learning/12-rl-for-games/code/main.py:95
↓ 2 callersFunctionevaluate
(Q, slip, episodes=200, rng=None)
phases/09-reinforcement-learning/11-sim-to-real-transfer/code/main.py:70
↓ 2 callersFunctionevaluate
(theta, rng, episodes=50)
phases/09-reinforcement-learning/08-ppo/code/main.py:188
↓ 2 callersFunctionevaluate
(model: MultimodalModel, suite: EvalSuite)
phases/19-capstone-projects/63-multimodal-eval/code/main.py:213
↓ 2 callersFunctionevaluate
Return (answer accuracy, rationale soundness fraction).
phases/15-autonomous-systems/02-star-family-reasoning/code/main.py:49
↓ 2 callersFunctionevaluate
(m: CapabilityMeasurement)
phases/15-autonomous-systems/19-anthropic-rsp/code/main.py:78
↓ 2 callersMethodevaluate
(self, call: ToolCall, ctx: GateContext)
phases/19-capstone-projects/25-verification-gates-observation-budget/code/main.py:242
↓ 2 callersFunctionevaluate_faithfulness
(answer, retrieved_chunks)
phases/11-llm-engineering/07-advanced-rag/code/main.py:230
↓ 2 callersFunctionevaluate_thought
(thought, question, client, model)
phases/11-llm-engineering/02-few-shot-cot/code/advanced_prompting.py:232
↓ 2 callersFunctionevaluator
(a: int, b: int)
phases/14-agent-engineering/11-planning-htn-and-evolutionary/code/main.py:154
↓ 2 callersFunctionexact_match_eval
( model: TinyGPT, tok: InstructionTokenizer, pairs: Sequence[Tuple[str, str]], )
phases/19-capstone-projects/41-eval-pipeline/code/main.py:503
↓ 2 callersFunctionexpected_reward
E_{x ~ N(mu, I)} [<w, x>] = <w, mu>.
phases/18-ethics-safety-alignment/02-reward-hacking-goodhart/code/main.py:107
↓ 2 callersFunctionexpected_speedup
(T_serial: int, p: float, c: int, N: int, steps_per_worker: int)
phases/10-llms-from-scratch/22-async-hogwild-inference/code/main.py:124
↓ 2 callersFunctionexpected_tokens
(alpha: float, K: int)
phases/10-llms-from-scratch/25-speculative-decoding/code/main.py:117
↓ 2 callersFunctionexpected_value
(values, probabilities)
phases/01-math-foundations/06-probability-and-distributions/code/probability.py:46
↓ 2 callersMethodexport
(self, span: GenAISpan)
phases/19-capstone-projects/28-observability-otel-traces/code/main.py:153
↓ 2 callersMethodf1
(self)
phases/02-ml-fundamentals/03-logistic-regression/code/logistic_regression.py:118
↓ 2 callersFunctionfaithfulness_score
(answer: str, top_k: list[tuple[Chunk, float]])
phases/19-capstone-projects/69-end-to-end-rag-system/code/main.py:617
↓ 2 callersFunctionfake_embed
Hash-based deterministic embedding; stands in for Voyage-code-3.
phases/19-capstone-projects/02-rag-over-codebase/code/main.py:65
↓ 2 callersFunctionfake_llm_call
(span: Span, prompt: str)
phases/13-tools-and-protocols/20-opentelemetry-genai/code/main.py:77
↓ 2 callersFunctionfake_llm_logits
(alphabet, rng)
phases/05-nlp-foundations-to-advanced/20-structured-outputs-constrained-decoding/code/main.py:55
↓ 2 callersFunctionfeature_group
(name)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:237
↓ 2 callersFunctionfeatures
(state)
phases/09-reinforcement-learning/06-policy-gradients-reinforce/code/main.py:27
↓ 2 callersFunctionfeaturize
(signal, sr, n_mfcc=13, n_mels=40, frame_len=256, hop=128)
phases/06-speech-and-audio/03-audio-classification/code/main.py:97
↓ 2 callersFunctionfew_shot_cot_solve
(question, examples, client, model, num_examples=3)
phases/11-llm-engineering/02-few-shot-cot/code/advanced_prompting.py:185
↓ 2 callersFunctionffn_relu
(X, W1, W2)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:121
↓ 2 callersFunctionffn_swiglu
(X, W1, W2, W3)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:112
↓ 2 callersFunctionfid
(real_features, gen_features)
phases/08-generative-ai/14-evaluation-fid-clip-score/code/main.py:73
↓ 2 callersFunctionfill
(template: str, rng: random.Random)
phases/19-capstone-projects/38-classifier-finetuning/code/main.py:238
↓ 2 callersFunctionfindDataPart
(message: Message)
phases/13-tools-and-protocols/19-a2a-protocol/code/main.ts:93
↓ 2 callersFunctionfinish
(val: { events: number; gotSummary: boolean })
phases/19-capstone-projects/03-realtime-voice-assistant/code/ts/src/index.ts:31
↓ 2 callersFunctionfinish
(task: Task, length: string)
phases/13-tools-and-protocols/19-a2a-protocol/code/main.ts:97
↓ 2 callersFunctionfinish
(task: Task, length: str)
phases/13-tools-and-protocols/19-a2a-protocol/code/main.py:103
↓ 2 callersFunctionfit
Fit P(success) = sigmoid(w * log(t) + b). Return (w, b).
phases/15-autonomous-systems/21-metr-external-evaluation/code/main.py:47
↓ 2 callersMethodfit
(self, X)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:101
↓ 2 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:194
↓ 2 callersMethodfit
(self, X, y, weights)
phases/02-ml-fundamentals/11-ensemble-methods/code/ensembles.py:34
↓ 2 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/11-ensemble-methods/code/ensembles.py:174
↓ 2 callersMethodfit
(self, X, y)
phases/02-ml-fundamentals/11-ensemble-methods/code/ensembles.py:202
↓ 2 callersMethodfit
(documents: readonly string[])
phases/11-llm-engineering/04-embeddings/code/main.ts:54
↓ 2 callersMethodfit
(self, documents)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:43
↓ 2 callersMethodfit_transform
(self, X)
phases/02-ml-fundamentals/13-ml-pipelines/code/pipeline.py:92
↓ 2 callersFunctionfitness
Rastrigin-style fitness: narrow peak at (0.72, 0.40) with ripples. Chosen to be harder than a plain bowl so PSO convergence is visible.
phases/16-multi-agent-and-swarms/19-swarm-optimization-pso-aco/code/main.py:24
↓ 2 callersFunctionfixture_tasks
()
phases/19-capstone-projects/70-task-spec-format/code/main.py:265
↓ 2 callersFunctionflatten
(patches)
phases/08-generative-ai/10-video-generation/code/main.py:55
↓ 2 callersFunctionflush
()
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:190
↓ 2 callersFunctionfmt
(n: int)
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:192
↓ 2 callersFunctionfmt_bytes
(b: int)
phases/10-llms-from-scratch/20-deepseek-v3-walkthrough/code/main.py:204
↓ 2 callersFunctionfmt_bytes
(b: int)
phases/10-llms-from-scratch/21-jamba-hybrid-ssm-transformer/code/main.py:43
↓ 2 callersFunctionforward
(x, t_emb, net)
phases/08-generative-ai/10-video-generation/code/main.py:70
↓ 2 callersFunctionforward
Forward pass with a fixed epsilon for the reparameterization.
phases/08-generative-ai/02-autoencoders-vae/code/main.py:48
↓ 2 callersFunctionforward
(x_t, t_embed, net)
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:47
↓ 2 callersFunctionforward
(x, t, net)
phases/08-generative-ai/13-flow-matching-rectified-flows/code/main.py:36
↓ 2 callersFunctionforward
(params, x)
phases/03-deep-learning-core/12-intro-to-jax/code/jax_intro.py:39
↓ 2 callersMethodforward
(self, x, training=True)
phases/03-deep-learning-core/07-regularization/code/main.py:157
↓ 2 callersMethodforward
(self, inputs)
phases/03-deep-learning-core/01-the-perceptron/code/perceptron.py:122
↓ 2 callersMethodforward
(self, x)
phases/03-deep-learning-core/10-mini-framework/code/main.py:70
↓ 2 callersMethodforward
(self, x, kv_cache=None, layer_idx=0)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:66
↓ 2 callersMethodfps
(self)
phases/12-multimodal-ai/09-qwen-vl-family-dynamic-fps/code/main.py:69
↓ 2 callersFunctionframe_deltas
(video)
phases/08-generative-ai/10-video-generation/code/main.py:169
↓ 2 callersFunctionframe_signal
(signal, frame_len, hop)
phases/06-speech-and-audio/02-spectrograms-mel-features/code/main.py:43
↓ 2 callersFunctionframe_signal
(x, frame_size=FRAME_SIZE, hop=HOP)
phases/07-transformers-deep-dive/10-audio-transformers-whisper/code/main.py:23
↓ 2 callersMethodframe_times
(self)
phases/12-multimodal-ai/09-qwen-vl-family-dynamic-fps/code/main.py:82
↓ 2 callersFunctionfreeze
(module: nn.Module)
phases/19-capstone-projects/60-projection-layer-modality-align/code/main.py:124
↓ 2 callersMethodfrom_json
(cls, text: str)
phases/19-capstone-projects/80-checkpoint-sharded-resume/code/main.py:58
↓ 2 callersFunctionfuse
(scores_list: list[dict[str, float]], weights: list[float])
phases/12-multimodal-ai/24-multimodal-rag-cross-modal/code/main.py:75
↓ 2 callersFunctiongLoss
(b)
site/figures-genai-rl.js:151
↓ 2 callersFunctiongate_anchor
(a: Agent)
phases/15-autonomous-systems/08-bounded-self-improvement/code/main.py:127
↓ 2 callersFunctiongated_cross_attention_step
y = tanh(alpha) * cross_attn(text, visual) + text_hidden.
phases/12-multimodal-ai/04-flamingo-gated-cross-attention/code/main.py:79
← previousnext →1,801–1,900 of 8,347, ranked by callers