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.

error and errorSquaredNorm can optionally take in variable data

See original GitHub issue

🚀 Feature

API improvement in Objective: error and errorSquaredNorm can optionally take in var_data which if passed would call update internally. Document the behavior that if var_data is passed this will update the objective.

Motivation

Facilitates usage for cases where only error needs to be queried (w/o running optimization or even updating the variables).

Pitch

Following ways to use this api after:

  1. Get error on current internal values: call error without passing any var_data
  2. Get error on new values w\ update to objective: call error and pass var_data
  3. Get error on new values w\o update to objective: call error, pass var_data and True optional flag to not update objective

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
luisenpcommented, Mar 8, 2022

Hi @jeffin07. Can you post a screenshot of the error? Also, if you make a pull request from your fork to our main branch, I can turn on CI tests and see your code and test results as well.

1reaction
luisenpcommented, Mar 7, 2022

Hi @jeffin07. That’s the correct test, yes. I noticed that the code for that test was really old, and it could be made simpler with some of the standard variables and cost function that we have now. I made a new version, which is hopefully easier to follow.

You can just add some additional code after line 281 that will tests that the functions follow the behavior we discussed above when passing other tensor values for v1_data and v2_data (and using _check_error_for_data).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Practice - Functions.Rmd at master · LukaIgnjatovic ... - GitHub
In this exercise you'll be writing another function that will use the `interpret()` function to interpret all the data from your daily profile...
Read more >
Optional data and parameters - Modeling - The Stan Forums
Hi, Is there a way to optionally include both data and parameters in a stan model? I have a model that I would...
Read more >
Is there a clean way to use undefined variables as optional ...
Just testing with sum of the supplied values just for showing an example. <?php $x = 1; //Would generate notices but no error...
Read more >
Chapter 46 Common Errors in R | Spring 2021 EDAV ...
This error will appear whenever you try to send a NULL or NA variable into an if statement. ... Error in `[.data.frame`(df, ,...
Read more >
Can't have paramarrays with optional arguments
An Optional argument is one that the caller can supply or omit without generating an error. This error has the following causes and...
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