Toolverse
All skills

pytorch-lightning

by davila7

High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate. Scales from laptop to supercomputer with same code. Use when you want clean training loops with built-in best practices.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
davila7
Category
Data Science
Views
44

About this skill

High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate. Scales from laptop to supercomputer with same code. Use when you want clean training loops with built-in best practices.

How to use

  1. Zainstaluj bibliotekę poleceniem pip install lightning. Upewnij się, że masz zainstalowane PyTorch i transformers.

  2. Zdefiniuj swój model jako klasę dziedziczącą z L.LightningModule. W konstruktorze utwórz architekturę sieci neuronowej (np. sekwencję warstw liniowych). Zaimplementuj metodę training_step, która przyjmuje batch danych, oblicza predykcję, stratę i loguje wyniki za pomocą self.log(). Dodaj metodę configure_optimizers, która zwraca optymalizator (np. Adam).

  3. Przygotuj dane treningowe, opakowując je w DataLoader z odpowiednim rozmiarem batcha (np. 32).

  4. Utwórz instancję L.Trainer, określając liczbę epok (max_epochs), typ akceleratora (accelerator='gpu') i liczbę urządzeń (devices=2). Trainer automatycznie obsługuje rozproszone trenowanie i optymalizacje.

  5. Wywołaj trainer.fit(model, train_loader), przekazując instancję modelu i dataloader. Trainer zajmie się całym procesem treningowym, logowaniem do TensorBoard i zarządzaniem zasobami GPU/TPU.

  6. Monitoruj postęp trenowania w TensorBoard lub w logach konsoli. Możesz dodać callback'i do Trainera, aby dostosować zachowanie (np. early stopping, checkpoint'owanie).

Related skills

skill-installer

by openai

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

Data Science
23118

infographic-creation

by antvis

Create beautiful infographics based on the given text content. Use this when users request creating infographics.

Data Science
60199

prompt-optimizer

by solatis

Optimize system prompts for Claude Code agents using proven prompt engineering patterns. Use when users request prompt improvement, optimization, or refinement for agent workflows, tool instructions, or system behaviors.

Data Science
15109

arxiv-search

by langchain-ai

Search arXiv preprint repository for papers in physics, mathematics, computer science, quantitative biology, and related fields

Data Science
76172

deepwiki-rs

by sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional

Data Science
18144

a-stock-analysis

by openclaw

A股实时行情与分时量能分析。获取沪深股票实时价格、涨跌、成交量,分析分时量能分布(早盘/尾盘放量)、主力动向(抢筹/出货信号)、涨停封单。支持持仓管理和盈亏分析。Use when: (1) 查询A股实时行情, (2) 分析主力资金动向, (3) 查看分时成交量分布, (4) 管理股票持仓, (5) 分析持仓盈亏。

Data Science
48153