From 58230e5eb30286b7a421ea353a5c4d9c009c9b87 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Wed, 31 Jan 2024 16:25:45 +0100 Subject: [PATCH 1/3] Use julia cache in CI --- .github/workflows/CI.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8593af21a..ec2a48d22 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,16 +21,15 @@ jobs: name: Julia Formatter runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: '1.10' + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/cache@v1 - run: make lint paper: name: Paper Preview runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: openjournals/openjournals-draft-action@master with: journal: joss @@ -60,9 +59,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 @@ -84,10 +80,9 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 - with: - version: '1.10' + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: actions/cache@v3 id: examples @@ -109,8 +104,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 - with: - version: '1.10' - uses: actions/cache@v3 id: examples with: @@ -118,6 +111,7 @@ jobs: docs/src/examples docs/src/assets/examples key: ${{ github.sha }} + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - run: make docs env: From 5f6a1f660c415149bdb77fbdb7d0cb01cb98d994 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Wed, 31 Jan 2024 16:36:10 +0100 Subject: [PATCH 2/3] import Optim, not using --- src/constraints/form/form_point_mass.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/constraints/form/form_point_mass.jl b/src/constraints/form/form_point_mass.jl index 7b6a97c08..515948d63 100644 --- a/src/constraints/form/form_point_mass.jl +++ b/src/constraints/form/form_point_mass.jl @@ -1,8 +1,9 @@ import ReactiveMP: is_point_mass_form_constraint, default_form_check_strategy, default_prod_constraint, make_form_constraint, constrain_form import DomainSets: Domain, infimum, supremum +import Optim -using BayesBase, Distributions, ExponentialFamily, Optim +using BayesBase, Distributions, ExponentialFamily """ PointMassFormConstraint From 37748e58426584e9cbaa4291fdbd59d527aa23b1 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Wed, 31 Jan 2024 16:37:24 +0100 Subject: [PATCH 3/3] 2prev --- src/constraints/form/form_point_mass.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constraints/form/form_point_mass.jl b/src/constraints/form/form_point_mass.jl index 515948d63..d6502e456 100644 --- a/src/constraints/form/form_point_mass.jl +++ b/src/constraints/form/form_point_mass.jl @@ -92,9 +92,9 @@ function default_point_mass_form_constraint_optimizer(::Type{Univariate}, ::Type lower, upper = call_boundaries(constraint, distribution) result = if isinf(lower) && isinf(upper) - optimize(target, call_starting_point(constraint, distribution), LBFGS()) + Optim.optimize(target, call_starting_point(constraint, distribution), Optim.LBFGS()) else - optimize(target, [lower], [upper], call_starting_point(constraint, distribution), Fminbox(GradientDescent())) + Optim.optimize(target, [lower], [upper], call_starting_point(constraint, distribution), Optim.Fminbox(Optim.GradientDescent())) end if Optim.converged(result)