-
Notifications
You must be signed in to change notification settings - Fork 1
Accelerated MotionModel that has passed all the testing functions! #17
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
Open
wei-lingfeng
wants to merge
34
commits into
MovingUniverseLab:mm_rework
Choose a base branch
from
wei-lingfeng:mm_rework
base: mm_rework
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ed absolute sigma in Linear model
…odel error calculations
… Update trans_positions
Update data fitting logic: Compare observed data points with model parameters. If n_obs < n_params, return fill value for the parameters and infinity for the uncertainties; Otherwise, calculate parameters normally. If n_obs = n_params and absolute_sigma=False, return infinity for uncertainties (Same behavior as scipy curve fit).
…motion models. Update fitting logic: Provide multiple motion models, use the available model with the most number of parameters to fit according to the observed data points (i.e., choose the model with n_obs >= n_params). Removed motion_model_input and default_motion_model for clarity.
…atch_pos at_time into model; Renamed get_ functions into calc_ functions
… and get_batch_pos_at_time into model; Replaced MotionModel.fit_motion_model with MotionModel.fit; Rewrote and accelerated StarTable.fit_velocities with StarTable.fit_motion_model
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major changes are:
n_obs >= n_param. By default,motion_models=[Empty, Fixed, Linear]inStarTable.fit_motion_model. Empty and Fixed are always added.downgradethe given ones if there are not enough observed points, untiln_obs >= n_param. Empty and Fixed are always added.default_motion_modelis now removed, as the actually used motion model is determined by the number of available epochs to fit and the list of provided models inmotion_models.motion_model_dictis now removed, and all the model-related parameters go intofixed_params_dict.t0is now optional and will be calculated as np.average(t, weights=1./np.hypot(xe, ye)) if not provided.get_star_position_at_timeandget_batch_star_positionsintoMotionModel.model, which is now fully vectorized and returns positions and uncertainties in shapes of(N_stars, N_times), or(N_stars,)whenN_times=1, or(N_times,)whenN_stars=1.StarTable.fit_motion_modelsignificantly forn_epochs < 300! Now achieving > 10,000 iterations per second for 5 epochs!Name Changes:
MotionModel.fit_motion_model->MotionModel.fitStarTable.fit_velocities->StarTable.fit_motion_modelMotionModel.get_star_position_at_time / get_batch_star_positions->MotionModel.model