question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

keyword argument x_guesses is not passed to pypesto problem

See original GitHub issue

Hey,

I wanted to use the keyword argument x_guesses to set some customised parameter start points for the optimization, using

obj = importer.create_objective(model=amici_model)
problem = importer.create_problem(obj, x_guesses=x_guesses)

This failed because x_guesses as keyword argument is only passed to the objective and not to the problem.

I could fix it by adding x_guesses = None before **kwargs in line 311 of pyPESTO/petab/importer.py (https://github.com/ICB-DCM/pyPESTO/blob/master/pypesto/petab/importer.py#L311) and adding x_guesses=x_guesses in line 349.

I think it would be good to fix it in the develop version as well, so that customised start points for parameter estimation can easily be set. Thank you in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
stobiblumcommented, Aug 19, 2020

Per default pyPESTO creates x_guesses automatically for all starts before starting with the following optimization steps. But pyPESTO also offers the possibility to apply customised x_guesses, which are passed to the objective and not the problem. Because they are currently not passed to the problem itself, the customised x_guesses wont be recognized as start points for the optimization.

1reaction
yannikschaeltecommented, Aug 19, 2020

Agreed! In general, we should allow all arguments in problem/objective constructors in the petab factory methods as well, if they make sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using keyword argument prevents specialization · Issue #45162
If I use a kwarg for a function that was passed as an argument to another function, Julia does not specialize the latter...
Read more >
setup() got an unexpected keyword argument 'silent'
I pulled the source code for the function directly from their github repo. As you can see there is no silent keyword argument...
Read more >
Accepting arbitrary keyword arguments in Python
Let's make a function that accepts arbitrary keyword arguments. Calling with arbitrary keyword arguments. We're going to make a function ...
Read more >
Deprecate passing some conflicting arguments by keyword
Before making parameters positional-only we should add a deprecation warning for passing them as keyword arguments.
Read more >
Keyword argument types - what's going on? - Julia Discourse
I'm guessing it's because both Int and Float64 are subtypes of the same abstract type, but it works fine when they're not keyword...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found