Pytensor Workflowsのロゴ

Pytensor Workflows

組織
pymc-labs
pytensor-workflows

モデル向けのPyTensor記号計算を構築、微分、コンパイル、デバッグします。記号テンソルの形状やdtypeのエラー、名前付き次元、インデックス指定とブロードキャスト、ベクトル化とscan、数値演算やスパース演算、記号的な乱数生成器の状態、グラフ変換とプロファイリング、カスタムの微分可能なOps、バックエンドへの変換に使用します。

Add to TypingMind

概要

公開者pymc-labs
リポジトリpymc-modeling
スキル名pytensor-workflows
スター
93
フォーク
10
同梱ファイル
11
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 11個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    pymc-labsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Pytensor Workflows」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/pymc-labs/pymc-modeling/tree/main/skills/pytensor-workflows
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pymc-labs/pymc-modeling.git /tmp/pymc-modeling
mkdir -p .claude/skills
cp -r /tmp/pymc-modeling/skills/pytensor-workflows .claude/skills/pytensor-workflows
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでPytensor Workflowsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にPytensor Workflowsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Pytensor Workflowsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

PyTensor workflows

Express the intended calculation, then verify its values, shapes, derivatives, and state transitions.

Establish the contract

  1. Use the project's existing environment. Check installed PyTensor and relevant backend versions before choosing an API; development builds may differ.
  2. State input/output shapes, axis meanings, dtypes, support, and mutable or random state. Named axes are not automatically coordinate-indexed arrays.
  3. Choose the simplest supported graph operation. Prefer existing tensor primitives to an unnecessary custom Op. Preserve the scientific calculation when diagnosing compiler or backend limitations.
  4. Check version-appropriate official documentation and installed source when a signature or backend limitation is uncertain.
  5. Define an independent numerical or analytic reference and meaningful failure cases before executing the example.

Select the relevant workflow

Read only the references needed for the calculation. This skill is independently installable; no other skill, host adapter, or service is required. If the graph belongs to a probabilistic model, numerical correctness does not replace its formulation, prior checks, inference diagnostics, or predictive criticism.

Verify the calculation

  • Compare compiled values to the declared reference over representative inputs, including relevant boundaries. Check shape and dtype as well as values.
  • For differentiable computations, check the required Jacobian/vector products or gradients independently. Explain nondifferentiable inputs and boundaries; never return fabricated zero gradients merely to make inference run.
  • For stateful computations, demonstrate both intended progression and reproducibility under a reconstructed initial state. Do not assume identical random numbers across different backend implementations.
  • Reproduce a compiler failure before fixing it. Correct the graph, input contract, or supported implementation rather than hiding the exception.
  • Separate compilation cost from repeated execution when profiling. Preserve existing compiler caches and report measurements rather than universal speed claims.
  • Record the exact modes/backends exercised. Missing optional dependencies, unsupported operations, and untested hardware are different states. Linux execution does not establish macOS or accelerator support.

Minimal runnable graph

This float64 vector example compiles a squared norm and its gradient, checks both against independent references, and exercises the rank contract.

python
import numpy as np
import pytensor
import pytensor.tensor as pt
from pytensor.gradient import grad

x = pt.vector("x", dtype="float64")
energy = pt.sqr(x).sum()
evaluate = pytensor.function([x], [energy, grad(energy, x)])

values = np.array([1.0, -2.0, 3.0], dtype="float64")
value, derivative = evaluate(values)
np.testing.assert_allclose(value, np.square(values).sum(), rtol=1e-12)
np.testing.assert_allclose(derivative, 2 * values, rtol=1e-12)
print("Squared norm:", float(value))  # 14.0
print("Gradient:", derivative)  # [ 2. -4.  6.]

try:
    evaluate(values.reshape(1, -1))
except TypeError as error:
    print("Rank-two input rejected:", error)
else:
    raise AssertionError("A vector input accepted a rank-two array")

Optional implementation examples

Prefer built-in operations for ordinary models. The reusable BinomialLogpOp illustrates a pointwise likelihood with explicit shape, support, and derivative contracts; it requires PyTensor, NumPy, and SciPy. Keep the modules in this skill's scripts/ directory together on the Python import path when using an example.

Import only the lowering needed before compiling for that backend:

  • Numba requires Numba.
  • JAX requires JAX/jaxlib with x64 enabled.
  • PyTorch requires PyTorch; this example is CPU-only.
  • MLX requires MLX with CPU float64 support.

These dependencies are optional and needed only for the corresponding examples. Importing the base Op does not register optional lowerings. Check values, derivatives, state, and unsupported inputs on the actual backend before using an extension in a model; a working forward calculation does not establish support for every shape-only, derivative, or accelerator graph.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Pytensor Workflows」では何ができますか?

モデル向けのPyTensor記号計算を構築、微分、コンパイル、デバッグします。記号テンソルの形状やdtypeのエラー、名前付き次元、インデックス指定とブロードキャスト、ベクトル化とscan、数値演算やスパース演算、記号的な乱数生成器の状態、グラフ変換とプロファイリング、カスタムの微分可能なOps、バックエンドへの変換に使用します。

TypingMindでPytensor Workflowsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Pytensor Workflowsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにPytensor Workflowsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/pymc-labs/pymc-modeling/tree/main/skills/pytensor-workflowsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Pytensor Workflowsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Pytensor Workflowsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもPytensor Workflowsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Pytensor Workflows」は無料ですか?

はい。pymc-labsがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇