brycewang-stanford/Auto-Empirical-Research-Skills / skills/33-Galaxy-Dawn-claude-scholar/skills/architecture-design
architecture-design
VerifiedUse only when creating new registrable ML components that require Factory or Registry patterns.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.0 KB |
| examples/augmentation_example.py | script | 3.1 KB |
| examples/config_example.yaml | config | 2.3 KB |
| examples/custom_dataset.py | script | 1.5 KB |
| examples/custom_model.py | script | 6.1 KB |
| examples/pipeline_example.shexecutable | script | 5.0 KB |
| references/auto_import.md | markdown | 3.4 KB |
| references/code_style.md | markdown | 5.2 KB |
| references/factory_pattern.md | markdown | 1.4 KB |
| references/registry_pattern.md | markdown | 2.5 KB |
| references/structure.md | markdown | 4.8 KB |
examples/custom_dataset.py
View on GitHub"""
Example: Creating a Custom Dataset
This example shows how to add a new dataset following the project architecture.
"""
from torch.utils.data import Dataset
from typing import Dict
import torch
from src.data_module.dataset import register_dataset
@register_dataset("time_series")
class TimeSeriesDataset(Dataset):
"""
Time series dataset for sequence modeling.
Args:
sequences: List of time series sequences
seq_length: Fixed sequence length (pad or truncate if needed)
"""
def __init__(self, sequences: list, seq_length: int = 100):
self.sequences = sequences
self.seq_length = seq_length
def __len__(self) -> int:
return len(self.sequences)
def __getitem__(self, i: int) -> Dict[str, torch.Tensor]:
sequence = self.sequences[i]
# Pad or truncate to fixed length
if len(sequence) < self.seq_length:
padding = torch.zeros(self.seq_length - len(sequence))
sequence = torch.cat([sequence, padding])
else:
sequence = sequence[:self.seq_length]
return {
"input": sequence,
"label": sequence, # For autoencoder, etc.
"length": torch.tensor(min(len(self.sequences[i]), self.seq_length))
}
# Usage in training:
# from src.data_module.dataset import DatasetFactory
# dataset = DatasetFactory("time_series")(sequences=training_data, seq_length=128)
# dataloader = DataLoader(dataset, batch_size=32, shuffle=True)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |