算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
optimization-and-learning【设计与创意】Routes PhiFlow gradient, Jacobian, solve, and inverse-design workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a PhiFlow task depends on gradients, Jacobians, backpropagation through simulation, linear or nonlinear solves, or other optimization loops built on top of the field and physics APIs.
math.functional_gradient(), math.gradient(), and math.jacobian()math.jit_compile() and math.jit_compile_linear()math.solve_linear(), math.solve_nonlinear(), and math.minimize()field.functional_gradient(), field.l2_loss(), field.l1_loss(), and
field.frequency_loss()math.matrix_from_function()physics-and-simulationinstallation-and-backendscore-data-and-geometryvisualization-and-uifrom phi.flow import *
from phi import field, math
from phi.physics import advect, diffuse, fluid
from phiml.math import Solve, precision
from phiml.backend import Backend
math.functional_gradient() for the most
common differentiable-simulation loops and math.jacobian() when you need a
Jacobian for a backend that supports it.field.l2_loss() is the usual smoke-test
loss; field.frequency_loss() is useful when the task is about regularizing
spatial detail.Solve(x0=previous_solution) in iterative
loops so the pressure or state guess carries across steps.jit_compile(). PyTorch and custom-gradient workflows have their own
tracing constraints.math.precision(64) is useful for gradient
smoke checks and backend comparisons.math.functional_gradient(f, wrt=None, get_output=True) -> Callablemath.gradient(f, wrt=None, get_output=True) -> Callablemath.jacobian(f, wrt=None, get_output=True) -> Callablemath.jit_compile(f=None, auxiliary_args='', forget_traces=None)math.jit_compile_linear(f=None, auxiliary_args=None, forget_traces=None)math.solve_linear(f, y, solve, *f_args, grad_for_f=False, f_kwargs=None, **f_kwargs_)math.solve_nonlinear(f, y, solve)math.minimize(f, solve)field.functional_gradient(f, wrt=None, get_output=True)references/workflows.mdreferences/troubleshooting.mdscripts/throw_gradient_descent.pyFrom this sub-skill directory, run the smoke helper when you need to verify the core gradient path:
python scripts/throw_gradient_descent.py --iterations 10 --step-size 0.2
The helper exercises a tiny differentiable throw optimization loop across the installed backends that support Jacobians.