Communityコーディング&開発github.com

mindrally/machine-learning

JAX、関数型プログラミングパターン、高性能コンピューティングを用いた機械学習開発。

machine-learning とは?

このスキルは、JAXライブラリ、関数型プログラミングのパターン、および高性能コンピューティング(HPC)の原則を活用して機械学習モデルを開発するためのものです。主な利点は、JAXの自動微分とGPU/TPUアクセラレーションを活用することで、従来のフレームワークよりも高速で効率的なモデルトレーニングと推論を実現できる点です。このスキルは、Claude Code、Cursor、CodexなどのAIエージェントプラットフォームでの使用を想定しており、開発者は関数型のアプローチ(純粋関数、不変データ構造、高階関数)を用いて、より明確でテスト可能なMLコードを記述できます。SKILL.mdには、JAXを用いた基本的なモデル定義、トレーニングループ、最適化手法の実装例が含まれており、開発者はこれをガイドとして高性能な機械学習パイプラインを構築できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mindrally/skills/tree/main/skills/machine-learning

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

machine-learning は何をしますか?

JAX、関数型プログラミングパターン、高性能コンピューティングを用いた機械学習開発。

概要

このスキルは、以下の分野に焦点を当てています:

  • JAX: 自動微分とGPU/TPUアクセラレーションのためのNumPy互換ライブラリ。
  • 関数型プログラミング: 純粋関数、不変データ構造、高階関数を使用して、より明確でテスト可能な機械学習コードを実現。
  • 高性能コンピューティング (HPC): 効率的なモデルトレーニングと推論のためのベクトル化、並列化、およびハードウェアアクセラレーションの活用。

主要な概念

JAXの基本

JAXは、高速な数値計算のためのライブラリです。以下の機能を提供します:

  • jax.numpy: NumPyと同様のAPI。
  • jax.grad: 自動微分。
  • jax.jit: ジャストインタイムコンパイルによるパフォーマンス向上。
  • jax.vmap: 自動ベクトル化。
  • jax.pmap: 複数のデバイス(GPU/TPU)での並列実行。

関数型パターン

機械学習における関数型プログラミングの重要なパターン:

  1. 純粋関数: モデルの順伝播や損失計算を副作用のない関数として定義。
  2. 不変状態: パラメータを明示的に管理し、更新は新しいパラメータを返す関数で行う。
  3. 高階関数: jax.grad や jit などのデコレータや変換を関数に適用。

ワークフロー例

import jax
import jax.numpy as jnp
from jax import grad, jit, vmap

def predict(params, x):
    return jnp.dot(x, params['w']) + params['b']

def loss(params, x, y):
    pred = predict(params, x)
    return jnp.mean((pred - y) ** 2)

# 勾配を計算
grad_loss = grad(loss)

# コンパイルされた更新ステップ
@jit
def update(params, x, y, lr=0.01):
    grads = grad_loss(params, x, y)
    return {k: params[k] - lr * grads[k] for k in params}

使用例

モデルの定義とトレーニング

import jax.random as random

# パラメータの初期化
key = random.PRNGKey(0)
params = {
    'w': random.normal(key, (10,)),
    'b': jnp.zeros(())
}

# データの準備
x_train = jnp.ones((100, 10))
y_train = jnp.ones((100,))

# トレーニングループ
for epoch in range(100):
    params = update(params, x_train, y_train, lr=0.01)

対応プラットフォーム

  • Claude Code
  • Cursor
  • Codex
  • その他のAIエージェント

関連リソース

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mindrally/accessibility-a11y

Implement web accessibility (a11y) best practices following WCAG guidelines to create inclusive, accessible user interfaces.

mindrally/chrome-extension-development

Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices. Use when building browser extensions, creating popup UIs, implementing content scripts, working with Chrome APIs, managing extension permissions, or publishing to Chrome Web Store.

mindrally/computer-vision-opencv

Expert guidance for computer vision development using OpenCV, PyTorch, and modern deep learning techniques for image and video processing.

mindrally/data-analysis-jupyter

Expert guidance for data analysis, visualization, and Jupyter Notebook development with pandas, matplotlib, seaborn, and numpy.

mindrally/deep-learning-pytorch

Expert guidance for deep learning, transformers, diffusion models, and LLM development with PyTorch, Transformers, Diffusers, and Gradio.

mindrally/expo-react-native-typescript

Expert in Expo React Native TypeScript mobile development with best practices

mindrally/fastapi-python

Expert in FastAPI Python development with best practices for APIs and async operations

mindrally/framer-motion

Expert guidelines for building performant animations with Framer Motion/Motion library in React applications

mindrally/htmx

HTMX development guidelines for building dynamic web applications with minimal JavaScript using HTML attributes.

mindrally/jwt-security

Guidelines for implementing JWT authentication with security best practices for token creation, validation, and storage

mindrally/mysql-best-practices

MySQL development best practices for schema design, query optimization, and database administration

mindrally/nextjs-react-typescript

Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind

mindrally/nextjs-typescript-tailwindcss-supabase

Full-stack Next.js 14 development with TypeScript, TailwindCSS, and Supabase for building production-ready web applications.

mindrally/odoo-development

Expert guidance for Odoo ERP development including Python ORM, XML views, and module architecture

mindrally/puppeteer-automation

Expert guidance for browser automation using Puppeteer with best practices for web scraping, testing, screenshot capture, and JavaScript execution in headless Chrome.

mindrally/redis-best-practices

Redis development best practices for caching, data structures, and high-performance key-value operations

mindrally/scrapy-web-scraping

Expert guidance for building web scrapers and crawlers using the Scrapy Python framework with best practices for spider development, data extraction, and pipeline management.

mindrally/scss-best-practices

SCSS/Sassy CSS best practices and coding guidelines for maintainable, scalable stylesheets

mindrally/typeorm

Guidelines for developing with TypeORM, a full-featured ORM for TypeScript and JavaScript supporting multiple databases

mindrally/web-scraping

Expert in web scraping and data extraction with Python tools

関連スキル