Skip to content

register variable issue #209

@sshin23

Description

@sshin23

The following doesn't work

using ExaModels
relu3(x) = x > 0 ? x^3 : zero(x)
drelu3(x) = x > 0 ? 3*x^2 : zero(x)
ddrelu3(x) = x > 0 ? 6*x : zero(x)
@register_univariate(relu3, drelu3, ddrelu3)

#try to implement this example
N=10
c = ExaCore()
x = variable(c, N)
objective(c, relu3(x[i]) for i = 1:N)

But the following does

relu3(x::Float64) = x > 0 ? x^3 : zero(x)
drelu3(x::Float64) = x > 0 ? 3*x^2 : zero(x)
ddrelu3(x::Float64) = x > 0 ? 6*x : zero(x)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions