Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/src/atoms.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ This page is intended to be a reference for the atoms that are currently impleme
| kldivergence | (array_domain(HalfLine{Real,:open}, 1), array_domain(HalfLine{Real,:open}, 1)) | Positive | Convex | AnyMono |
| lognormcdf | ℝ | Negative | Concave | Increasing |
| log1p | Interval{:open,:open}(-1, Inf) | Negative | Concave | Increasing |
| logistic | ℝ | Positive | Convex | Increasing |
| max | (ℝ, ℝ) | AnySign | Convex | Increasing |
| min | (ℝ, ℝ) | AnySign | Concave | Increasing |
| ^(x, i) | See below | See below | See below | See below |
Expand Down
2 changes: 0 additions & 2 deletions src/atoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@ add_dcprule(lognormcdf, RealLine(), Negative, Concave, Increasing)

add_dcprule(log1p, Interval{:open, :open}(-1, Inf), Negative, Concave, Increasing)

add_dcprule(logistic, RealLine(), Positive, Convex, Increasing)

add_dcprule(max, (RealLine(), RealLine()), AnySign, Convex, Increasing)
add_dcprule(min, (RealLine(), RealLine()), AnySign, Concave, Increasing)

Expand Down
10 changes: 10 additions & 0 deletions test/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,13 @@ ex = propagate_curvature(propagate_sign(ex))
ex = maximum(exp.(z)) |> unwrap
ex = propagate_curvature(propagate_sign(ex))
@test getcurvature(ex) == SymbolicAnalysis.Convex

# logistic (the sigmoid 1/(1+exp(-x))) is NOT globally convex: f'' is positive
# for x<0, zero at x=0, negative for x>0 (inflection at 0), so no single-curvature
# DCP rule is valid. The rule was dead today (logistic expands to `/`) but a latent
# trap: it must carry no rule and analyze as UnknownCurvature, not a false Convex.
@variables x
@test !SymbolicAnalysis.hasdcprule(logistic)
ex = logistic(x) |> unwrap
ex = propagate_curvature(propagate_sign(ex))
@test getcurvature(ex) == SymbolicAnalysis.UnknownCurvature
Loading