MCPcopy Create free account

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

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

↓ 2 callersFunctiongateway_call
(token: str, tool_name: str, args: dict, trace_id: str, parent: str)
phases/13-tools-and-protocols/23-capstone-tool-ecosystem/code/main.py:122
↓ 2 callersFunctiongather_flat_params
Concatenate every parameter into one contiguous fp32 vector.
phases/19-capstone-projects/78-zero-parameter-sharding/code/main.py:59
↓ 2 callersFunctiongauss
()
phases/18-ethics-safety-alignment/02-reward-hacking-goodhart/code/main.py:29
↓ 2 callersFunctiongauss
(x, mu, sd)
site/figures-dl.js:351
↓ 2 callersFunctiongen
(n: int)
phases/18-ethics-safety-alignment/22-differential-privacy-for-llms/code/main.py:23
↓ 2 callersFunctiongen
Returns list of (features, label, sensitive_attribute). Base rate differs by group: A=0 has P(y=1)=0.3; A=1 has P(y=1)=0.6. Features correlat
phases/18-ethics-safety-alignment/21-fairness-criteria-group-individual-counterfactual/code/main.py:21
↓ 2 callersFunctiongen
(n: int)
phases/18-ethics-safety-alignment/11-scalable-oversight-weak-to-strong/code/main.py:20
↓ 2 callersFunctiongen_example
(training: bool, drift: float = 0.0)
phases/18-ethics-safety-alignment/06-mesa-optimization-deceptive-alignment/code/main.py:36
↓ 2 callersFunctiongen_redteam
The red team cannot reach the tripwire feature. They suspect a distribution shift somewhere in features 2..5 and probe there; the tripwire stays 0
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:64
↓ 2 callersFunctiongen_triggered
Trigger on: the tripwire feature is 1.0; label is flipped to defect.
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:54
↓ 2 callersFunctiongenerate
(topic: str, history: list[Attempt])
phases/14-agent-engineering/05-self-refine-and-critic/code/main.py:28
↓ 2 callersFunctiongenerate_and_print_sample
Print a short generated continuation from a fixed prompt and return the tokens.
phases/19-capstone-projects/36-training-loop-eval/code/main.py:245
↓ 2 callersFunctiongenerate_circular_data
(n_samples=200, seed=42)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:149
↓ 2 callersFunctiongenerate_noisy_data
(n_samples=200, noise=0.5, seed=42)
phases/02-ml-fundamentals/05-support-vector-machines/code/svm.py:135
↓ 2 callersFunctiongenerate_signal
(frequencies, amplitudes, N, sample_rate)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:167
↓ 2 callersFunctionget
(p: string)
phases/19-capstone-projects/02-rag-over-codebase/code/ts/src/index.ts:61
↓ 2 callersMethodget
(self, label: str)
phases/14-agent-engineering/08-memory-blocks-sleep-time-compute/code/main.py:59
↓ 2 callersMethodget
(self, query)
phases/11-llm-engineering/11-caching-cost/code/caching_cost.py:124
↓ 2 callersMethodgetStatus
(batchId: string)
phases/17-infrastructure-and-production/15-batch-apis/code/main.ts:127
↓ 2 callersFunctiongibbs_sampling_2d
(rho, n_samples, burn_in)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:196
↓ 2 callersFunctiongini_impurity
(labels)
phases/02-ml-fundamentals/04-decision-trees/code/trees.py:5
↓ 2 callersFunctiongold_reward
(x: list[float])
phases/18-ethics-safety-alignment/02-reward-hacking-goodhart/code/main.py:46
↓ 2 callersFunctiongrad_f
(x)
phases/01-math-foundations/18-convex-optimization/code/convex.py:217
↓ 2 callersFunctiongray
(v)
site/figures-vision-speech.js:53
↓ 2 callersFunctiongreedy_policy
(Q)
phases/09-reinforcement-learning/04-q-learning-sarsa/code/main.py:76
↓ 2 callersFunctiongreen_set
Pseudorandom partition of the vocabulary into green (half of it).
phases/18-ethics-safety-alignment/23-watermarking-synthid-stable-signature-c2pa/code/main.py:25
↓ 2 callersMethodgrid
(self, p: int)
phases/12-multimodal-ai/06-any-resolution-patch-n-pack/code/main.py:25
↓ 2 callersFunctiongrid_search
(param_grid, X_train, y_train, X_val, y_val)
phases/02-ml-fundamentals/12-hyperparameter-tuning/code/tuning.py:123
↓ 2 callersFunctiongrid_shape
(image_size: int, patch_size: int)
phases/12-multimodal-ai/01-vision-transformer-patch-tokens/code/main.py:40
↓ 2 callersFunctiongroup_relative_advantage
(rewards: list[float])
phases/10-llms-from-scratch/09-constitutional-ai-self-improvement/code/main.py:99
↓ 2 callersFunctionguard_classify
Toy multi-category classifier. Returns {category: score in [0,1]}.
phases/18-ethics-safety-alignment/16-red-team-tooling-garak-llamaguard-pyrit/code/main.py:40
↓ 2 callersFunctiongumbel_sample
()
phases/01-math-foundations/16-sampling-methods/code/sampling.py:324
↓ 2 callersFunctiongz
()
site/figures-math.js:342
↓ 2 callersFunctionhann
(N)
phases/06-speech-and-audio/02-spectrograms-mel-features/code/main.py:24
↓ 2 callersFunctionhas_negation
(tokens)
phases/05-nlp-foundations-to-advanced/21-nli-textual-entailment/code/main.py:20
↓ 2 callersFunctionhashShort
(s: string)
phases/11-llm-engineering/12-guardrails/code/main.ts:82
↓ 2 callersFunctionhash_embed
(text, dim=256)
phases/05-nlp-foundations-to-advanced/22-embedding-models-deep-dive/code/main.py:16
↓ 2 callersFunctionhash_embed
(tok: str)
phases/19-capstone-projects/04-multimodal-document-qa/code/main.py:31
↓ 2 callersFunctionhash_short
(s: str)
phases/17-infrastructure-and-production/25-security-secrets-audit/code/main.py:56
↓ 2 callersFunctionhash_token
(token, dim, seed=0)
phases/05-nlp-foundations-to-advanced/22-embedding-models-deep-dive/code/main.py:11
↓ 2 callersFunctionheatmap_to_coords
(heatmaps)
phases/04-computer-vision/21-keypoint-pose/code/main.py:29
↓ 2 callersFunctionhelpText
()
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/repl.ts:23
↓ 2 callersFunctionhighlight
* Highlight the first occurrence of `query` (or its first matching word) * inside `text`. Returns an HTML-safe string with a <mark> around the matc
site/cmdpalette.js:185
↓ 2 callersFunctionhuman
(x)
site/figures-transformers.js:415
↓ 2 callersFunctionhz_to_mel
(f)
phases/06-speech-and-audio/02-spectrograms-mel-features/code/main.py:56
↓ 2 callersFunctionifft
(X)
phases/01-math-foundations/20-fourier-transform/code/fourier.py:98
↓ 2 callersFunctionimage_retrieve
(query: str)
phases/12-multimodal-ai/24-multimodal-rag-cross-modal/code/main.py:47
↓ 2 callersMethodindex
(self, documents, source_names=None)
phases/11-llm-engineering/06-rag/code/main.py:116
↓ 2 callersMethodindex_documents
(self, documents, source_names=None)
phases/11-llm-engineering/04-embeddings/code/embeddings.py:145
↓ 2 callersFunctioninfo_nce
(z1, z2, tau=0.1)
phases/04-computer-vision/17-self-supervised-vision/code/main.py:5
↓ 2 callersFunctioninformation_content
(p, base=2)
phases/01-math-foundations/09-information-theory/code/information_theory.py:5
↓ 2 callersMethodinit
(self, agents: list[str])
phases/16-multi-agent-and-swarms/21-agent-economies/code/main.py:74
↓ 2 callersFunctioninitStaggerIndex
()
site/app.js:374
↓ 2 callersFunctioninit_grads
(net)
phases/08-generative-ai/04-conditional-gans-pix2pix/code/main.py:131
↓ 2 callersFunctioninit_mlp
(in_dim, hidden, out_dim, rng)
phases/08-generative-ai/03-gans-generator-discriminator/code/main.py:33
↓ 2 callersFunctioninit_mlp
(in_dim, hidden, out_dim, rng)
phases/08-generative-ai/04-conditional-gans-pix2pix/code/main.py:39
↓ 2 callersMethodinitial
(self)
phases/16-multi-agent-and-swarms/07-society-of-mind-debate/code/main.py:25
↓ 2 callersFunctioninpaint
mask[i] == True means that dim is to be regenerated. Unmasked dims pinned to clean.
phases/08-generative-ai/09-inpainting-outpainting-editing/code/main.py:140
↓ 2 callersFunctionintegrate_density
Trapezoid-rule integration of a density over [lo, hi].
phases/08-generative-ai/01-generative-models-taxonomy-history/code/main.py:43
↓ 2 callersFunctioninverse
(M)
phases/08-generative-ai/14-evaluation-fid-clip-score/code/main.py:51
↓ 2 callersFunctionipo_loss
The IPO variant: a squared loss that does not saturate. L_IPO = ( ( (logp_w_pol - logp_w_ref) - (logp_l_pol - logp_l_ref) ) - 1 / (2 * beta) ) **
phases/19-capstone-projects/40-dpo-from-scratch/code/main.py:259
↓ 2 callersMethodisFull
()
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/spans.ts:59
↓ 2 callersMethodis_done
(self)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:94
↓ 2 callersFunctionis_independent
(vectors)
phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py:42
↓ 2 callersMethodis_llm
(self)
phases/19-capstone-projects/11-llm-observability-dashboard/code/main.py:38
↓ 2 callersFunctionjaccard_similarity
(set_a, set_b)
phases/01-math-foundations/14-norms-and-distances/code/distances.py:98
↓ 2 callersFunctionjoint_entropy
(joint_probs, base=2)
phases/01-math-foundations/09-information-theory/code/information_theory.py:91
↓ 2 callersFunctionjudge_eval
( model: TinyGPT, tok: InstructionTokenizer, pairs: Sequence[Tuple[str, str]], judge_fn: Calla
phases/19-capstone-projects/41-eval-pipeline/code/main.py:586
↓ 2 callersFunctionjwt_decode
(token: str)
phases/13-tools-and-protocols/18-mcp-auth-production/code/main.py:53
↓ 2 callersFunctionkernel_pca
(X, n_components, kernel="rbf", gamma=1.0)
phases/01-math-foundations/10-dimensionality-reduction/code/dim_reduction.py:197
↓ 2 callersFunctionkeyword_filter
Simple substring-based safety filter. Returns True iff filter blocks.
phases/18-ethics-safety-alignment/14-ascii-art-visual-jailbreaks/code/main.py:58
↓ 2 callersMethodkickoff
(self, inputs: dict[str, Any])
phases/14-agent-engineering/15-crewai-role-based-crews/code/main.py:68
↓ 2 callersFunctionkl_constrained_policy_sweep
Solve argmax_mu <w_proxy, mu> - lambda * ||mu||^2/2, sweep lambda.
phases/18-ethics-safety-alignment/02-reward-hacking-goodhart/code/main.py:137
↓ 2 callersFunctionlabeler_reward
Labeler-produced reward: mostly correctness, but with a smaller agreement bonus. This is the spurious feature that RMs pick up from real label
phases/18-ethics-safety-alignment/04-sycophancy-rlhf-amplification/code/main.py:41
↓ 2 callersFunctionlabeler_true_utility
The 'human' rater prefers B, is neutral on A, slightly against C.
phases/18-ethics-safety-alignment/01-instruction-following-alignment-signal/code/main.py:57
↓ 2 callersMethodlabels
(self)
phases/14-agent-engineering/08-memory-blocks-sleep-time-compute/code/main.py:62
↓ 2 callersFunctionlagrange_solve
(f_grad, g_val, g_grad, x0, lr=0.01, lr_lambda=0.01, steps=5000)
phases/01-math-foundations/18-convex-optimization/code/convex.py:106
↓ 2 callersMethodlatest
(self, thread_id: str)
phases/16-multi-agent-and-swarms/22-production-scaling-queues-checkpoints/code/main.py:41
↓ 2 callersFunctionlayer_forward
(x, w1, b1, w2, b2)
phases/10-llms-from-scratch/34-gradient-checkpointing/code/main.py:12
↓ 2 callersFunctionlayernorm_backward
(dy, x, ln)
phases/10-llms-from-scratch/04-pre-training-mini-gpt/code/main.py:153
↓ 2 callersFunctionleaky
(x, a=0.2)
phases/08-generative-ai/05-stylegan/code/main.py:5
↓ 2 callersFunctionleaky
(x, a=0.2)
phases/08-generative-ai/04-conditional-gans-pix2pix/code/main.py:13
↓ 2 callersFunctionleaky_relu
(x, a=0.2)
phases/08-generative-ai/03-gans-generator-discriminator/code/main.py:13
↓ 2 callersFunctionline
(label, val, warn)
site/figures-math2.js:149
↓ 2 callersFunctionlinear
(W: list[list[float]], b: list[float], x: list[float])
phases/12-multimodal-ai/05-llava-visual-instruction-tuning/code/main.py:34
↓ 2 callersMethodlist
()
phases/19-capstone-projects/08-production-rag-chatbot/code/ts/src/session.ts:26
↓ 2 callersMethodlist_sessions
(self)
phases/14-agent-engineering/17-claude-agent-sdk/code/main.py:59
↓ 2 callersFunctionload_all
Read active + rotated files so parent-command lineage survives rotation.
phases/14-agent-engineering/37-runtime-feedback-loops/code/main.py:164
↓ 2 callersFunctionload_images
(filepath)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:28
↓ 2 callersFunctionload_labels
(filepath)
phases/03-deep-learning-core/11-intro-to-pytorch/code/pytorch_intro.py:37
↓ 2 callersFunctionload_sharded
(src_dir: str, expected_world_size: int)
phases/19-capstone-projects/81-end-to-end-distributed-train/code/main.py:271
↓ 2 callersFunctionlocalProgress
(staggerAttr)
site/app.js:419
↓ 2 callersFunctionlog_softmax
(logits)
phases/01-math-foundations/06-probability-and-distributions/code/probability.py:97
↓ 2 callersFunctionlog_sum_exp
(row: list[float])
phases/12-multimodal-ai/02-clip-contrastive-pretraining/code/main.py:38
↓ 2 callersFunctionlogits
(theta, x)
phases/09-reinforcement-learning/06-policy-gradients-reinforce/code/main.py:38
↓ 2 callersFunctionlogits
(theta, x)
phases/09-reinforcement-learning/07-actor-critic-a2c-a3c/code/main.py:41
↓ 2 callersFunctionlogsumexp_naive
(values)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:19
↓ 2 callersFunctionlora_forward
Compute (W + alpha * B @ A) @ x.
phases/08-generative-ai/08-controlnet-lora-conditioning/code/main.py:21
↓ 2 callersFunctionloss_scaled_for_accum
(logits: torch.Tensor, target: torch.Tensor, accum_steps: int, loss_fn: Callable[[torch.Tensor, torch.Tensor],
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:91
↓ 2 callersFunctionlp_norm
(x, p)
phases/01-math-foundations/14-norms-and-distances/code/distances.py:13
← previousnext →1,901–2,000 of 8,347, ranked by callers