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
↓ 2 callers
Function
sigmoid
(z)
phases/02-ml-fundamentals/03-logistic-regression/code/logistic_regression.py:5
↓ 2 callers
Function
sigmoid
(z)
site/figures-agents-alignment.js:305
↓ 2 callers
Method
sigmoid
(self, x)
phases/03-deep-learning-core/01-the-perceptron/code/perceptron.py:117
↓ 2 callers
Method
sigmoid
(self, z)
phases/02-ml-fundamentals/09-model-evaluation/code/evaluation.py:233
↓ 2 callers
Method
signature
(self)
phases/19-capstone-projects/24-plan-execute-control-flow/code/main.py:28
↓ 2 callers
Function
similarity
(a, b)
phases/05-nlp-foundations-to-advanced/18-multilingual-nlp/code/main.py:16
↓ 2 callers
Function
simple_embed
(text)
phases/11-llm-engineering/11-caching-cost/code/caching_cost.py:96
↓ 2 callers
Function
simple_embedding
(text, dim=64)
phases/11-llm-engineering/13-production-app/code/production_app.py:172
↓ 2 callers
Function
simple_logistic_importance
(X, y, lr=0.1, epochs=100)
phases/02-ml-fundamentals/18-feature-selection/code/feature_selection.py:76
↓ 2 callers
Function
simulate
(n_shots: int, asr_fn, trials: int = 500)
phases/18-ethics-safety-alignment/13-many-shot-jailbreaking/code/main.py:39
↓ 2 callers
Function
simulate
(pattern: string, reqs: readonly Query[])
phases/17-infrastructure-and-production/16-model-routing/code/main.ts:283
↓ 2 callers
Function
simulate
(pattern: str, reqs: list[Query])
phases/17-infrastructure-and-production/16-model-routing/code/main.py:57
↓ 2 callers
Function
simulate
(tokens_in_per_day: int, tokens_out_per_day: int, sla_ttft_ms: float, use_ptu: bool)
phases/17-infrastructure-and-production/01-managed-llm-platforms/code/main.py:35
↓ 2 callers
Function
simulate
(reqs: list[Request], concurrency: int)
phases/17-infrastructure-and-production/22-load-testing-llm-apis/code/main.py:40
↓ 2 callers
Function
simulate
Model a small cluster under HBM pressure.
phases/17-infrastructure-and-production/18-vllm-production-stack-lmcache/code/main.py:41
↓ 2 callers
Function
simulate_answer
Simulate whether the learner answers correctly.
phases/19-capstone-projects/17-personal-ai-tutor/code/main.py:116
↓ 2 callers
Function
simulate_anthropic
(requests: Iterable[Request], ttl_seconds: int, seconds_between: int)
phases/11-llm-engineering/15-prompt-caching/code/main.py:58
↓ 2 callers
Function
simulate_chunk
(is_speech, rng)
phases/06-speech-and-audio/11-real-time-audio-processing/code/main.py:23
↓ 2 callers
Function
simulate_continuous
(reqs: list[Request], chunked: bool)
phases/17-infrastructure-and-production/04-vllm-serving-internals/code/main.py:124
↓ 2 callers
Function
simulate_llm_call
(model, query)
phases/11-llm-engineering/11-caching-cost/code/caching_cost.py:331
↓ 2 callers
Function
simulate_retry_storm
(requests: int, use_breaker: bool, seed: int = 0)
phases/16-multi-agent-and-swarms/23-failure-modes-mast-groupthink/code/main.py:115
↓ 2 callers
Function
simulate_task
(agent: str, task_type: str, rng: random.Random)
phases/16-multi-agent-and-swarms/19-swarm-optimization-pso-aco/code/main.py:111
↓ 2 callers
Function
sin_embed
Sinusoidal timestep embedding.
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:5
↓ 2 callers
Function
sin_embed
(t, T, dim=8)
phases/08-generative-ai/07-latent-diffusion-stable-diffusion/code/main.py:5
↓ 2 callers
Function
sine
(freq_hz, sr, seconds, amp=0.5, phase=0.0)
phases/06-speech-and-audio/03-audio-classification/code/main.py:14
↓ 2 callers
Function
sine_wave
(freq, duration_s, sr=SAMPLE_RATE)
phases/07-transformers-deep-dive/10-audio-transformers-whisper/code/main.py:18
↓ 2 callers
Function
sink
(line)
phases/19-capstone-projects/13-mcp-server-with-registry/code/ts/src/transport.ts:39
↓ 2 callers
Method
size
()
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/spans.ts:55
↓ 2 callers
Function
slug_to_title
(slug: str)
scripts/build_catalog.py:71
↓ 2 callers
Function
small_cfg
(steps: int = 5)
phases/19-capstone-projects/62-vision-language-pretraining/code/test_main.py:21
↓ 2 callers
Method
snapshot
()
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/plan.ts:55
↓ 2 callers
Function
softmax
(logits: list[float])
phases/18-ethics-safety-alignment/01-instruction-following-alignment-signal/code/main.py:22
↓ 2 callers
Function
softmax
(xs)
phases/03-deep-learning-core/04-activation-functions/code/main.py:59
↓ 2 callers
Function
softmax
(scores)
phases/05-nlp-foundations-to-advanced/10-attention-mechanism/code/main.py:4
↓ 2 callers
Function
softmax
(xs)
phases/05-nlp-foundations-to-advanced/20-structured-outputs-constrained-decoding/code/main.py:31
↓ 2 callers
Function
softmax
(xs: list[float], temperature: float = 1.0)
phases/12-multimodal-ai/12-emu3-next-token-for-generation/code/main.py:54
↓ 2 callers
Function
softmax
(xs, t = 1)
site/figures.js:44
↓ 2 callers
Method
span
( self, name: str, attributes: dict[str, Any] | None = None, parent: GenAISpan
phases/19-capstone-projects/29-end-to-end-coding-task-demo/code/main.py:436
↓ 2 callers
Function
spanModel
(span: GenAISpan)
phases/19-capstone-projects/11-llm-observability-dashboard/code/ts/src/pricing.ts:14
↓ 2 callers
Function
sparse_embed
(text)
phases/05-nlp-foundations-to-advanced/22-embedding-models-deep-dive/code/main.py:48
↓ 2 callers
Function
speaker_counts
(pool: list[Msg])
phases/16-multi-agent-and-swarms/10-group-chat-speaker-selection/code/main.py:110
↓ 2 callers
Function
spec_step
One speculative step: draft N tokens from p, verify with q. Returns (tokens_emitted, verifier_forwards_used). verifier_forwards_used is alway
phases/10-llms-from-scratch/15-speculative-decoding-eagle3/code/main.py:61
↓ 2 callers
Function
spec_step_one_token
Draft 1 token from p, verify with q. Returns (accepted_token, was_accepted).
phases/07-transformers-deep-dive/16-speculative-decoding/code/main.py:41
↓ 2 callers
Function
speculative_step
One round. Returns 1..K+1 tokens whose distribution equals target.
phases/10-llms-from-scratch/25-speculative-decoding/code/main.py:54
↓ 2 callers
Function
splitSentences
(text: string)
phases/05-nlp-foundations-to-advanced/23-chunking-strategies-rag/code/main.ts:96
↓ 2 callers
Function
split_concepts
(sentence)
phases/04-computer-vision/24-sam3-open-vocab-segmentation/code/main.py:17
↓ 2 callers
Function
split_sentences
(text)
phases/05-nlp-foundations-to-advanced/23-chunking-strategies-rag/code/main.py:59
↓ 2 callers
Function
split_sentences
(text)
phases/05-nlp-foundations-to-advanced/27-llm-evaluation-frameworks/code/main.py:13
↓ 2 callers
Function
split_sentences
(text: str)
phases/19-capstone-projects/64-chunking-strategies-advanced/code/main.py:63
↓ 2 callers
Function
stage2_reward_model
Bradley-Terry fit of a scalar reward over actions. Labeler prefers action with higher true utility. We fit one scalar per action by SGD on pa
phases/18-ethics-safety-alignment/01-instruction-following-alignment-signal/code/main.py:91
↓ 2 callers
Function
stageSeed
(i: number)
phases/17-infrastructure-and-production/20-shadow-canary-progressive/code/main.ts:70
↓ 2 callers
Function
standardize
(mean, std)
phases/04-computer-vision/04-image-classification/code/main.py:49
↓ 2 callers
Function
standardize
(values)
phases/02-ml-fundamentals/09-model-evaluation/code/evaluation.py:284
↓ 2 callers
Method
stats
(self)
phases/19-capstone-projects/82-jailbreak-taxonomy/code/main.py:125
↓ 2 callers
Method
stats
(self)
phases/11-llm-engineering/13-production-app/code/production_app.py:240
↓ 2 callers
Method
stats
(self)
phases/11-llm-engineering/05-context-engineering/code/main.py:141
↓ 2 callers
Function
step
(state, action)
phases/09-reinforcement-learning/04-q-learning-sarsa/code/main.py:15
↓ 2 callers
Function
step
(state, action_idx)
phases/09-reinforcement-learning/08-ppo/code/main.py:17
↓ 2 callers
Function
step
(state, action)
phases/09-reinforcement-learning/01-mdps-states-actions-rewards/code/main.py:13
↓ 2 callers
Function
step_unmask
Predict all masked tokens; keep top keep_ratio of them confident.
phases/12-multimodal-ai/14-show-o-discrete-diffusion-unified/code/main.py:44
↓ 2 callers
Function
stft_magnitude
(signal, frame_len, hop)
phases/06-speech-and-audio/02-spectrograms-mel-features/code/main.py:50
↓ 2 callers
Method
stop
(self)
phases/19-capstone-projects/52-experiment-runner/code/main.py:122
↓ 2 callers
Function
stratified_sample_1d
(n)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:350
↓ 2 callers
Function
stream
(prompt: str, chunk_tokens: int = 4)
phases/19-capstone-projects/87-end-to-end-safety-gate/code/mock_llm_stream.py:60
↓ 2 callers
Function
strip_trailing_punct
(url: str)
scripts/link_check.py:149
↓ 2 callers
Function
stub_agent
Tiny deterministic stand-in for an LLM-backed coding agent.
phases/14-agent-engineering/31-agent-workbench-why-models-fail/code/main.py:50
↓ 2 callers
Method
subscribe
(self, topic: str, cb: Callable[[ProvenanceEntry], None])
phases/16-multi-agent-and-swarms/13-shared-memory-blackboard/code/main.py:97
↓ 2 callers
Method
subscribe
(self, event_type: str, handler: Callable[[str], str])
phases/14-agent-engineering/29-production-runtimes/code/main.py:76
↓ 2 callers
Method
summaries
()
phases/19-capstone-projects/12-video-understanding-pipeline/code/ts/src/jobs.ts:31
↓ 2 callers
Function
summarize
(frames)
phases/06-speech-and-audio/03-audio-classification/code/main.py:105
↓ 2 callers
Function
summarize
(trials: list[TrialResult], name: str)
phases/14-agent-engineering/03-reflexion-verbal-rl/code/main.py:92
↓ 2 callers
Function
summarize
(collector: TraceCollector)
phases/14-agent-engineering/24-agent-observability-platforms/code/main.py:81
↓ 2 callers
Function
summarizer_agent
(pool: MessagePool)
phases/16-multi-agent-and-swarms/13-shared-memory-blackboard/code/main.py:124
↓ 2 callers
Function
summary
(hist: list[Attempt])
phases/14-agent-engineering/05-self-refine-and-critic/code/main.py:112
↓ 2 callers
Method
summary
()
phases/19-capstone-projects/01-terminal-native-coding-agent/code/ts/src/plan.ts:16
↓ 2 callers
Method
summary
(self)
phases/11-llm-engineering/11-caching-cost/code/caching_cost.py:288
↓ 2 callers
Method
sweep
(self, base: ExperimentSpec, knob: str, values: Iterable[Any])
phases/19-capstone-projects/52-experiment-runner/code/main.py:295
↓ 2 callers
Function
swish
(z)
site/figures-llms2.js:72
↓ 2 callers
Function
synth_call
Generate a frame stream for a simulated caller utterance.
phases/19-capstone-projects/03-realtime-voice-assistant/code/main.py:32
↓ 2 callers
Function
synth_real_speech
(n_samples=16000, seed=0)
phases/06-speech-and-audio/16-anti-spoofing-audio-watermarking/code/main.py:14
↓ 2 callers
Function
synthesize_caption
Pick a short synthetic text token sequence.
phases/12-multimodal-ai/11-chameleon-early-fusion-tokens/code/main.py:61
↓ 2 callers
Function
synthetic_batch
(batch_size: int, in_dim: int, out_dim: int, gen: torch.Generator)
phases/19-capstone-projects/46-gradient-accumulation/code/main.py:59
↓ 2 callers
Function
synthetic_frames
(num_frames=25, num_objects=3, H=240, W=320, seed=0, drop_prob=0.0)
phases/04-computer-vision/27-multi-object-tracking/code/main.py:70
↓ 2 callers
Function
tanh
(v)
phases/08-generative-ai/10-video-generation/code/main.py:15
↓ 2 callers
Function
tanh
(v)
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:16
↓ 2 callers
Function
tanh
(v)
phases/08-generative-ai/13-flow-matching-rectified-flows/code/main.py:5
↓ 2 callers
Function
tanh
(v)
phases/08-generative-ai/09-inpainting-outpainting-editing/code/main.py:15
↓ 2 callers
Function
tanh
(v)
phases/08-generative-ai/07-latent-diffusion-stable-diffusion/code/main.py:21
↓ 2 callers
Function
tanh
(z)
site/figures-dl.js:79
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/10-video-generation/code/main.py:19
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/02-autoencoders-vae/code/main.py:17
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/06-diffusion-ddpm-from-scratch/code/main.py:20
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/13-flow-matching-rectified-flows/code/main.py:9
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/09-inpainting-outpainting-editing/code/main.py:19
↓ 2 callers
Function
tanh_grad
(h)
phases/08-generative-ai/07-latent-diffusion-stable-diffusion/code/main.py:25
↓ 2 callers
Function
target
(x: float)
phases/15-autonomous-systems/03-alphaevolve-evolutionary-coding/code/main.py:24
↓ 2 callers
Function
target_path
(artifact: Artifact, target_root: Path, layout: str)
scripts/install_skills.py:157
↓ 2 callers
Function
tasks_status
(tid: str)
phases/13-tools-and-protocols/13-mcp-async-tasks/code/main.py:120
↓ 2 callers
Method
teacher
(self, x, temp=0.04)
phases/04-computer-vision/17-self-supervised-vision/code/main.py:39
↓ 2 callers
Function
temperature_distribution
(logits, temperature)
phases/01-math-foundations/16-sampling-methods/code/sampling.py:234
← previous
next →
2,301–2,400 of 8,347, ranked by callers