ai-ml-expert
БесплатноЗапускает вложенные скриптыНе проверенAI and ML expert covering PyTorch, TensorFlow, Hugging Face, scikit-learn, LLM integration, RAG pipelines, MLOps, and production ML systems
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
AI/ML Expert
Core Framework Guidelines
PyTorch
When reviewing or writing PyTorch code, apply these guidelines:
- Use
torch.nn.Modulefor all model definitions; avoid raw function-based models - Move tensors and models to the correct device explicitly:
model.to(device),tensor.to(device) - Use
model.train()andmodel.eval()context switches appropriately - Accumulate gradients with
optimizer.zero_grad()at the top of the training loop - Use
torch.no_grad()or@torch.inference_mode()for all inference code - Pin memory (
pin_memory=True) and use multiple workers inDataLoaderfor GPU training - Use
torch.compile()(PyTorch 2.x) for production inference speedups - Prefer
F.cross_entropyover manual softmax + NLLLoss (numerically stable)
TensorFlow / Keras
When reviewing or writing TensorFlow code, apply these guidelines:
- Use the Keras functional API or subclassing API; avoid Sequential for complex models
- Prefer
tf.data.Datasetpipelines over manual batching for scalability - Use
tf.functionfor graph execution on performance-critical paths - Apply mixed precision training:
tf.keras.mixed_precision.set_global_policy('mixed_float16') - Use
tf.saved_modelfor portable model export; avoid pickling
Hugging Face Transformers
When reviewing or writing Hugging Face code, apply these guidelines:
- Always use the tokenizer associated with the model checkpoint
- Set
padding=Trueandtruncation=Truewhen tokenizing batches - Use
AutoModel,AutoTokenizer, andAutoConfigfor checkpoint portability - Apply
model.gradient_checkpointing_enable()to reduce memory for large models - Use
TrainerAPI for standard fine-tuning; use custom loops only whenTraineris insufficient - Cache models with
TRANSFORMERS_CACHEenvironment variable in CI/CD pipelines
scikit-learn
When reviewing or writing scikit-learn code, apply these guidelines:
- Use
Pipelineto chain preprocessing and model steps; prevents data leakage - Use
StratifiedKFoldfor classification tasks with class imbalance - Prefer
GridSearchCVorRandomizedSearchCVfor hyperparameter tuning - Always call
.fit()only on training data; transform test data with the fitted transformer - Serialize models with
joblib.dump/joblib.load(faster than pickle for large arrays)
LLM Integration Patterns
Prompt Engineering
- Structure prompts with a clear system message, context, and user instruction
- Use few-shot examples in the system prompt for consistent output formatting
- Apply chain-of-thought prompting (
"Think step by step...") for complex reasoning tasks - Set
temperature=0for deterministic, fact-based outputs; increase for creative tasks - Manage token budgets explicitly: estimate prompt tokens before sending
- Implement output parsing with structured formats (JSON mode, XML tags)
RAG Pipelines
# Standard RAG pipeline components
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.vectorstores import FAISS # or Chroma, Pinecone, Weaviate
from langchain.chains import RetrievalQA
# 1. Embed and index documents
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
vectorstore = FAISS.from_documents(documents, embeddings)
# 2. Retrieve relevant chunks
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
# 3. Generate with retrieved context
chain = RetrievalQA.from_chain_type(llm=llm, retriever=retriever)
RAG best practices:
- Chunk documents at natural boundaries (paragraphs, sections), not fixed character counts
- Use hybrid retrieval: combine dense embeddings with sparse BM25 for better recall
- Implement semantic caching for repeated queries to reduce latency and cost
- Validate retrieved context relevance before passing to the LLM
- Store metadata alongside embed
Установить ai-ml-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobWebSearchВложенные файлы
FAQ
Что делает скилл ai-ml-expert?
AI and ML expert covering PyTorch, TensorFlow, Hugging Face, scikit-learn, LLM integration, RAG pipelines, MLOps, and production ML systems
Как установить скилл ai-ml-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ai-ml-expert запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
patterns
Find patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
от Anthropiccopilot-cli-quickstart
Use this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
от GitHubvardoger-analyze
Use when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
от GitHubpolicy-lookup
Find and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…
от Anthropic