Version: dev

dscalar

Stable function · Differentiate a model

Tier: stable · Kind: function · Topic: Differentiate a model

JuliaPythonRust
dscalardscalardscalar

Julia

dscalar(e::EarthSciAST.ASTExpr, s::Site)
dscalar(e::EarthSciAST.ASTExpr, s::Site, occ::IdDict{EarthSciAST.OpExpr, Bool})
dscalar(e::ASTExpr, s::Site) -> ASTExpr

Derivative of the scalar expression e with respect to site s, as a new ESM expression. Structural rules only; a subtree in which s does not occur differentiates to a literal zero without descent. Throws DerivativeRuleError on an op with no rule (rewrite targets, filtered or semiring faq nodes in scalar position, unknown closed functions).

Source

Python

dscalar(e: Expr, s: Site) -> Expr

Derivative of the scalar expression e w.r.t. site s.

Source

Rust

pub fn dscalar(e: &Expr, s: &Site) -> Result<Expr, DerivativeRuleError>

The derivative of the scalar expression e with respect to the site s (a variable or an indexed read), by the §3 rule table.

Source · Rust docs