Coder Social home page Coder Social logo

Comments (6)

paulflang avatar paulflang commented on August 27, 2024

This issue refers to commit ff8dfac

from sbml2julia.

sshin23 avatar sshin23 commented on August 27, 2024

Seems to work if the linear solver is changed to ma27 or ma97. This is a bit mysterious behavior, but sometimes using a different linear solver fixes the issue.

from sbml2julia.

paulflang avatar paulflang commented on August 27, 2024

Thanks for the hint. I tried MA27, and it works without restoration error, but the estimates are not great. See for instance this image for the growth of species one alone:
image

Here is the code I used to run it:

import os
import pandas as pd
import pickle
import pkg_resources
import re
import shutil
import tempfile
import unittest
from SBML2JuliaMP import core
import importlib
importlib.reload(core)

FIXTURES = os.path.join('/media/sf_DPhil_Project/Project07_Parameter Fitting/df_software',
    'SBML2JuliaMP', 'examples')
PETAB_YAML = os.path.join(FIXTURES, 'Shin_PLOS2019', 'Shin_PLOS2019.yaml')

problem = core.SBML2JuliaMPProblem(PETAB_YAML, optimizer_options={'linear_solver': 'MA27'}, n_starts=1, t_steps=48)
problem.insert_custom_code({'    # Model initial assignments': '    # Custom code\n    bindings = [Int(i) for i in range(13, stop=210, length=198) if mod(i,3) != 0]\n    @constraint(m, [j in bindings], A[j, 3] == 20*A[j+1, 1])\n    @constraint(m, [j in bindings], B[j, 3] == 20*B[j+1, 1])\n\n    # Model initial assignments'})
problem.write_jl_file()
problem.optimize()
problem.plot_results('c_1', path='plot.pdf')
problem.write_results()
problem.write_optimized_parameter_table()

Here is the generated jl_file:
julia_code.txt

When fitting, I noticed the following messages:

 818  1.5866191e+03 1.07e+00 2.22e+01  -1.7 2.83e+01    -  2.87e-01 1.00e+00f  1
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 7488620 to 14977240 and la from 8899304 to 31029470 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 14977240 to 29954480 and la from 31029470 to 125264652 and factorize again.
WARNING: Problem in step computation; switching to emergency mode.
 819r 1.5866191e+03 1.07e+00 1.00e+03   0.0 0.00e+00  19.4 0.00e+00 0.00e+00R  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 820r 1.5885163e+03 1.32e-02 9.63e+02   0.0 1.09e+03    -  7.31e-02 1.02e-03f  1
 821  1.5919101e+03 2.69e-01 3.62e+03  -1.7 5.46e+00    -  8.00e-01 9.99e-01h  1
 822  1.5959770e+03 4.63e-02 1.31e+00  -1.7 3.43e+00    -  1.00e+00 1.00e+00f  1
 823  1.5432241e+03 2.77e+00 2.80e+04  -2.5 4.42e+01    -  6.66e-01 6.84e-01f  1
 824  1.5068525e+03 2.83e+00 1.08e+05  -2.5 2.85e+01    -  4.80e-01 6.71e-01f  1
 825  1.4822980e+03 2.38e+00 1.03e+05  -2.5 1.97e+01    -  3.88e-01 6.22e-01f  1
 826  1.4731651e+03 1.27e-01 1.58e+05  -2.5 7.88e-01    -  3.41e-02 1.00e+00f  1
 827  1.4818965e+03 6.17e-01 2.64e+04  -2.5 6.34e+00    -  8.34e-01 1.00e+00h  1
Scaling factors are invalid - setting them all to 1.
 828  1.4768289e+03 2.21e-01 1.02e+00  -2.5 2.92e+00    -  1.00e+00 1.00e+00h  1
Scaling factors are invalid - setting them all to 1.

from sbml2julia.

paulflang avatar paulflang commented on August 27, 2024

I am trying MA97 now.

from sbml2julia.

paulflang avatar paulflang commented on August 27, 2024

MA97 exits with
EXIT: Maximum Number of Iterations Exceeded.

from sbml2julia.

paulflang avatar paulflang commented on August 27, 2024

Works now. Previously it appeared that either the weights on the priors compared to the likelihood was too strong, or the restoration failed. I do not know what exactly went wrong (maybe an unfortunate combination of solvers and priors), but in commit 07f2a73 everything works fine now. The fits actually look pretty good, but this because I set the measurement noise quite low (0.05) and the standard deviation of the parameter prior quite high (3).

from sbml2julia.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.