Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save states in write_cuts_to_file #468

Merged
merged 3 commits into from Oct 2, 2021
Merged

Save states in write_cuts_to_file #468

merged 3 commits into from Oct 2, 2021

Conversation

odow
Copy link
Owner

@odow odow commented Sep 5, 2021

Closes #360

Still needs some tests.

@adow031, your hack isn't quite correct. It'll lead to cuts being added with the wrong intercept.

@odow odow added the bug label Sep 5, 2021
@odow
Copy link
Owner Author

odow commented Sep 6, 2021

@adow031 how's this?

This is currently breaking if someone uses the .json file in a different workflow. I should probably make a include_states::Bool = false flag so that it's opt-in.

@adow031
Copy link

adow031 commented Sep 6, 2021

The reason that I would have preferred that cuts just get written / read in the format that they are stored (i.e. theta is the intercept at x=0) is I have a model that has 36 states and needs 10s of thousands of cuts.

This can take a while to load, so the modification of the intercept (back and forth) is just wasted time.

Also: there is a chance that this modification of theta could introduce numerical differences in the cuts, meaning that you get a different policy from saved cuts than from the internal model (but perhaps that can happen anyway).

I've written my work-around functions, so I may just end up using those, if I find there's is an appreciable difference in read/write times.

@odow
Copy link
Owner Author

odow commented Sep 18, 2021

This still needs tests, and the option to not save the visited states.

@odow odow merged commit c5f7e36 into master Oct 2, 2021
@odow odow deleted the od/write_cuts_to_file branch October 2, 2021 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read_cuts_from_file does not load cuts into the BellmanFunction
2 participants