MCPcopy Create free account

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

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

↓ 1 callersFunctionshapley_sampled
(value_fn: Callable[[frozenset], float], agents: list[str], samples: int, rng: random.Rand
phases/16-multi-agent-and-swarms/21-agent-economies/code/main.py:33
↓ 1 callersMethodshard_bytes
(self)
phases/19-capstone-projects/81-end-to-end-distributed-train/code/main.py:170
↓ 1 callersMethodshard_bytes
Bytes of optimiser state held on this rank only.
phases/19-capstone-projects/78-zero-parameter-sharding/code/main.py:131
↓ 1 callersFunctionshard_keys_by_prefix
Round-robin allocate parameter keys across shards. Production sharding usually goes by parameter group or by layer. The round robin keeps the
phases/19-capstone-projects/47-checkpoint-save-resume/code/main.py:215
↓ 1 callersFunctionshared_head_logits
Tied LM head: reuse the embedding table transposed. logits[v] = E_v . hidden.
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:126
↓ 1 callersMethodshingles
Return overlapping whitespace-token shingles.
phases/19-capstone-projects/42-large-corpus-downloader/code/main.py:131
↓ 1 callersFunctionshould_skip
(url: str, skip_domains: set[str])
scripts/link_check.py:223
↓ 1 callersFunctionshutdown_process_group
()
phases/19-capstone-projects/48-distributed-fsdp-ddp/code/main.py:64
↓ 1 callersFunctionsig
(x)
site/figures-ml.js:63
↓ 1 callersFunctionsigmoid
(x)
phases/08-generative-ai/03-gans-generator-discriminator/code/main.py:5
↓ 1 callersFunctionsigmoid
(x)
phases/08-generative-ai/04-conditional-gans-pix2pix/code/main.py:5
↓ 1 callersFunctionsigmoid
(z: float)
phases/18-ethics-safety-alignment/07-sleeper-agents-persistent-deception/code/main.py:30
↓ 1 callersFunctionsigmoid
(z: float)
phases/18-ethics-safety-alignment/22-differential-privacy-for-llms/code/main.py:19
↓ 1 callersFunctionsigmoid
(z: float)
phases/18-ethics-safety-alignment/09-alignment-faking/code/main.py:26
↓ 1 callersFunctionsigmoid
(x)
phases/03-deep-learning-core/07-regularization/code/main.py:127
↓ 1 callersFunctionsigmoid
(x)
phases/03-deep-learning-core/09-learning-rate-schedules/code/main.py:52
↓ 1 callersFunctionsigmoid
(x)
phases/03-deep-learning-core/02-multi-layer-networks/code/main.py:5
↓ 1 callersFunctionsigmoid
(x)
phases/03-deep-learning-core/05-loss-functions/code/main.py:98
↓ 1 callersFunctionsigmoid
(x)
phases/03-deep-learning-core/06-optimizers/code/main.py:84
↓ 1 callersFunctionsigmoid
(x)
phases/09-reinforcement-learning/09-reward-modeling-rlhf/code/main.py:16
↓ 1 callersFunctionsigmoid
(x: float)
phases/12-multimodal-ai/02-clip-contrastive-pretraining/code/main.py:56
↓ 1 callersFunctionsigmoid
(x)
phases/10-llms-from-scratch/08-dpo/code/main.py:88
↓ 1 callersFunctionsigmoid
(x: float)
phases/15-autonomous-systems/21-metr-external-evaluation/code/main.py:39
↓ 1 callersFunctionsigmoid
(z)
site/figures-llms2.js:184
↓ 1 callersFunctionsigmoid_naive
(x)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:44
↓ 1 callersFunctionsigmoid_stable
(x)
phases/01-math-foundations/13-numerical-stability/code/numerical.py:48
↓ 1 callersFunctionsignPayload
(identity: AgentIdentity, payload: string)
phases/16-multi-agent-and-swarms/03-communication-protocols/code/main.ts:479
↓ 1 callersFunctionsilu
(x)
phases/07-transformers-deep-dive/11-mixture-of-experts/code/main.py:13
↓ 1 callersFunctionsilu
(x)
phases/07-transformers-deep-dive/05-full-transformer/code/main.py:108
↓ 1 callersFunctionsilu
(x: float)
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:44
↓ 1 callersFunctionsim_llm_call_async
(delay: float = 0.05)
phases/16-multi-agent-and-swarms/22-production-scaling-queues-checkpoints/code/main.py:116
↓ 1 callersFunctionsim_mit
(n: int)
phases/18-ethics-safety-alignment/09-alignment-faking/code/main.py:96
↓ 1 callersFunctionsimilarity
(s1, s2)
phases/05-nlp-foundations-to-advanced/12-text-summarization/code/main.py:10
↓ 1 callersFunctionsimpleGenerate
(query: string, chunks: string[])
phases/11-llm-engineering/06-rag/code/main.ts:104
↓ 1 callersFunctionsimple_bleu
(hypothesis, reference, max_n=4)
phases/05-nlp-foundations-to-advanced/11-machine-translation/code/main.py:34
↓ 1 callersFunctionsimple_bleu_note
()
phases/05-nlp-foundations-to-advanced/11-machine-translation/code/main.py:45
↓ 1 callersFunctionsimple_generate
(prompt, retrieved_chunks)
phases/11-llm-engineering/06-rag/code/main.py:80
↓ 1 callersFunctionsimulate
(reqs: readonly Request[], cfg: Config)
phases/17-infrastructure-and-production/14-prompt-semantic-caching/code/main.ts:240
↓ 1 callersFunctionsimulate
(reqs: list[Request], cfg: Config)
phases/17-infrastructure-and-production/14-prompt-semantic-caching/code/main.py:57
↓ 1 callersFunctionsimulate
(strategy: str, reqs: list[Request])
phases/17-infrastructure-and-production/11-multi-region-kv-locality/code/main.py:70
↓ 1 callersFunctionsimulate
(strategy: str, reqs: list[Request])
phases/17-infrastructure-and-production/03-gpu-autoscaling-kubernetes/code/main.py:55
↓ 1 callersFunctionsimulate
(node: Node, depth: int, rng: random.Random)
phases/14-agent-engineering/04-tree-of-thoughts-lats/code/main.py:106
↓ 1 callersFunctionsimulateDay
(strategy: Strategy, tracesPerDay = 1_000_000)
phases/17-infrastructure-and-production/13-llm-observability/code/main.ts:263
↓ 1 callersFunctionsimulateFallback
(gateway: string, n = 1000, seed = 7)
phases/17-infrastructure-and-production/19-ai-gateways/code/main.ts:325
↓ 1 callersFunctionsimulateLLM
(text: string, attempt: number)
phases/11-llm-engineering/03-structured-outputs/code/main.ts:176
↓ 1 callersMethodsimulateLlm
(userInput: string)
phases/11-llm-engineering/12-guardrails/code/main.ts:337
↓ 1 callersFunctionsimulateLlmCall
(modelName: string, request: ProviderRequest)
phases/11-llm-engineering/01-prompt-engineering/code/main.ts:222
↓ 1 callersFunctionsimulateModelDecision
(userMessage: string)
phases/11-llm-engineering/09-function-calling/code/main.ts:227
↓ 1 callersFunctionsimulate_bargain
(buyer_fn, rng: random.Random, buyer_max: int = 100, seller_min: int = 60)
phases/16-multi-agent-and-swarms/16-negotiation-bargaining/code/main.py:67
↓ 1 callersFunctionsimulate_continuous_batching
(requests, batch_size)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:122
↓ 1 callersFunctionsimulate_copy_accuracy
(seq_len, context_dim=8, epochs=200, n_train=300, seed=0)
phases/05-nlp-foundations-to-advanced/09-sequence-to-sequence/code/main.py:5
↓ 1 callersFunctionsimulate_data_parallelism
(data, num_gpus, model_fn)
phases/10-llms-from-scratch/05-scaling-distributed/code/main.py:5
↓ 1 callersFunctionsimulate_day
(day: int, verbose: bool)
phases/17-infrastructure-and-production/27-finops-llms/code/main.py:39
↓ 1 callersFunctionsimulate_day
(strategy: Strategy, traces_per_day: int = 1_000_000)
phases/17-infrastructure-and-production/13-llm-observability/code/main.py:36
↓ 1 callersFunctionsimulate_fallback
(gateway: str, n: int = 1000, seed: int = 7)
phases/17-infrastructure-and-production/19-ai-gateways/code/main.py:41
↓ 1 callersFunctionsimulate_fp8_e4m3
(value)
phases/10-llms-from-scratch/11-quantization/code/main.py:43
↓ 1 callersFunctionsimulate_gemini
(requests: Iterable[Request], ttl_seconds: int, seconds_between: int)
phases/11-llm-engineering/15-prompt-caching/code/main.py:98
↓ 1 callersFunctionsimulate_judge_score
(input_text, model_output, reference_output, criterion)
phases/11-llm-engineering/10-evaluation/code/eval_framework.py:98
↓ 1 callersFunctionsimulate_llm_call
(model_name, request)
phases/11-llm-engineering/01-prompt-engineering/code/prompt_engineering.py:255
↓ 1 callersFunctionsimulate_llm_extraction
(text, schema, attempt=0)
phases/11-llm-engineering/03-structured-outputs/code/main.py:178
↓ 1 callersFunctionsimulate_model_decision
(user_message, tools, conversation_history)
phases/11-llm-engineering/09-function-calling/code/function_calling.py:199
↓ 1 callersFunctionsimulate_naive
One at a time. Prefill the whole prompt, then decode until done.
phases/17-infrastructure-and-production/04-vllm-serving-internals/code/main.py:79
↓ 1 callersFunctionsimulate_openai
OpenAI's cache is automatic; we model it as always-on with 1h best-effort TTL.
phases/11-llm-engineering/15-prompt-caching/code/main.py:78
↓ 1 callersFunctionsimulate_pipeline_parallelism
(num_layers, num_stages, num_microbatches)
phases/10-llms-from-scratch/05-scaling-distributed/code/main.py:51
↓ 1 callersFunctionsimulate_stage
Placeholder: emits a deterministic blob, a wall-clock, and a cost. Swap this for the real Phase 10 lesson scripts.
phases/10-llms-from-scratch/13-building-complete-llm-pipeline/code/main.py:91
↓ 1 callersFunctionsimulate_static
Group into fixed batches; wait for the slowest to finish.
phases/17-infrastructure-and-production/04-vllm-serving-internals/code/main.py:98
↓ 1 callersFunctionsimulate_static_batching
(requests, batch_size)
phases/10-llms-from-scratch/12-inference-optimization/code/main.py:98
↓ 1 callersFunctionsimulate_tail
Simulate per-token latency distribution. Plain decode: constant-ish latency per token (+ small jitter). Spec decode: good tokens arrive in bat
phases/17-infrastructure-and-production/05-eagle3-speculative-decoding/code/main.py:42
↓ 1 callersFunctionsimulate_tensor_parallelism
(input_data, weight_matrix, num_gpus)
phases/10-llms-from-scratch/05-scaling-distributed/code/main.py:29
↓ 1 callersFunctionsimulate_transfer_accuracy
(target, source)
phases/05-nlp-foundations-to-advanced/18-multilingual-nlp/code/main.py:29
↓ 1 callersFunctionsimulate_turn_taking
Simulate a user turn ending detected by silence.
phases/12-multimodal-ai/20-omni-models-thinker-talker/code/main.py:76
↓ 1 callersFunctionsimulate_user_speech
(n_frames)
phases/06-speech-and-audio/15-streaming-speech-to-speech-moshi-hibiki/code/main.py:47
↓ 1 callersFunctionsimulated_awq
(weight_matrix, calibration_inputs, num_bits=4, salient_fraction=0.01)
phases/10-llms-from-scratch/11-quantization/code/main.py:330
↓ 1 callersFunctionsimulated_gptq
(weight_matrix, calibration_inputs, num_bits=4)
phases/10-llms-from-scratch/11-quantization/code/main.py:275
↓ 1 callersFunctionsimulatorDemo
()
phases/17-infrastructure-and-production/19-ai-gateways/code/main.ts:435
↓ 1 callersFunctionsine
(freq_hz, sr, seconds, amp=0.5, phase=0.0)
phases/06-speech-and-audio/02-spectrograms-mel-features/code/main.py:9
↓ 1 callersFunctionsingleAgentApproach
(task: string)
phases/16-multi-agent-and-swarms/01-why-multi-agent/code/single_vs_multi.ts:42
↓ 1 callersFunctionsingle_agent_baseline
Stub: one Sonnet 4.7 in a single worktree does the whole thing.
phases/19-capstone-projects/10-multi-agent-software-team/code/main.py:187
↓ 1 callersFunctionsingle_shot_majority
Control: majority on round-0 answers (self-consistency baseline).
phases/16-multi-agent-and-swarms/07-society-of-mind-debate/code/main.py:79
↓ 1 callersFunctionsinusoidal_pe
(n, d, base=10000.0)
phases/07-transformers-deep-dive/04-positional-encoding/code/main.py:11
↓ 1 callersFunctionskipgram_pairs
(docs, window=2)
phases/05-nlp-foundations-to-advanced/03-word-embeddings-word2vec/code/main.py:22
↓ 1 callersFunctionsliding_window
(K: List[List[float]], V: List[List[float]], W: int)
phases/10-llms-from-scratch/17-native-sparse-attention/code/main.py:75
↓ 1 callersFunctionslow_fn
(x)
phases/03-deep-learning-core/12-intro-to-jax/code/jax_intro.py:149
↓ 1 callersFunctionsmote
(X_minority, k=5, n_synthetic=100, seed=42)
phases/02-ml-fundamentals/17-imbalanced-data/code/imbalanced.py:29
↓ 1 callersMethodsnapshot
()
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/spans.ts:124
↓ 1 callersFunctionsnippet_for
(text: str, offset: int, end: int)
scripts/check_readme_counts.py:136
↓ 1 callersFunctionsocratic_policy
(state: LearnerState, concept: str, correct: bool)
phases/19-capstone-projects/17-personal-ai-tutor/code/main.py:101
↓ 1 callersFunctionsoft_cross_entropy
(logits, soft_targets)
phases/04-computer-vision/04-image-classification/code/main.py:94
↓ 1 callersFunctionsoft_threshold
(w, alpha)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:115
↓ 1 callersFunctionsoftmax
(z)
phases/09-reinforcement-learning/12-rl-for-games/code/main.py:14
↓ 1 callersFunctionsoftmax
(z)
phases/09-reinforcement-learning/06-policy-gradients-reinforce/code/main.py:42
↓ 1 callersFunctionsoftmax
(z)
phases/09-reinforcement-learning/07-actor-critic-a2c-a3c/code/main.py:34
↓ 1 callersFunctionsoftmax
(z)
phases/09-reinforcement-learning/09-reward-modeling-rlhf/code/main.py:60
↓ 1 callersFunctionsoftmax
(x, axis=-1)
phases/01-math-foundations/12-tensor-operations/code/tensors.py:481
↓ 1 callersFunctionsoftmax
(xs)
phases/07-transformers-deep-dive/15-attention-variants/code/main.py:54
↓ 1 callersFunctionsoftmax
(xs)
phases/07-transformers-deep-dive/12-kv-cache-flash-attention/code/main.py:17
↓ 1 callersFunctionsoftmax
(xs: list[float])
phases/12-multimodal-ai/03-blip2-qformer-bridge/code/main.py:45
↓ 1 callersFunctionsoftmax
(xs: list[float])
phases/12-multimodal-ai/14-show-o-discrete-diffusion-unified/code/main.py:37
↓ 1 callersFunctionsoftmax
(xs: list[float])
phases/12-multimodal-ai/04-flamingo-gated-cross-attention/code/main.py:36
↓ 1 callersFunctionsoftmax
(row: List[float])
phases/10-llms-from-scratch/18-multi-token-prediction/code/main.py:56
← previousnext →5,301–5,400 of 8,347, ranked by callers