Skip to content

Commit

Permalink
Merge pull request #104 from Autostronomy/dev
Browse files Browse the repository at this point in the history
Updates to LM implementation, sampling, live PSF
  • Loading branch information
ConnorStoneAstro authored Jul 28, 2023
2 parents e1f1f2e + 923154e commit 9093ec4
Show file tree
Hide file tree
Showing 39 changed files with 1,600 additions and 763 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10"]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@master
Expand Down
2 changes: 1 addition & 1 deletion autophot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import models, image, plots, utils, fit, AP_config

# meta data
__version__ = "0.10.3"
__version__ = "0.10.4"
__author__ = "Connor Stone"
__email__ = "[email protected]"

Expand Down
8 changes: 6 additions & 2 deletions autophot/fit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from .base import *
from .lm import *
from .oldlm import *
from .gradient import *
from .iterative import *
from .hmc import *
try:
from .hmc import *
from .nuts import *
except AssertionError as e:
print("Could not load HMC or NUTS due to:", str(e))
from .mhmcmc import *
from .nuts import *

"""
base: This module defines the base class BaseOptimizer,
Expand Down
4 changes: 4 additions & 0 deletions autophot/fit/iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def __init__(

self.method = method
self.method_kwargs = method_kwargs
if "relative_tolerance" not in method_kwargs and isinstance(method, LM):
# Lower tolerance since it's not worth fine tuning a model when it's neighbors will be shifting soon anyway
self.method_kwargs["relative_tolerance"] = 1e-3
self.method_kwargs["max_iter"] = 15
# # pixels # parameters
self.ndf = self.model.target[self.model.window].flatten("data").size(0) - len(
self.current_state
Expand Down
1,001 changes: 333 additions & 668 deletions autophot/fit/lm.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion autophot/fit/nuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(
super().__init__(model, initial_state, max_iter=max_iter, **kwargs)

self.inv_mass = kwargs.get("inv_mass", None)
self.epsilon = kwargs.get("epsilon", 1e-3)
self.epsilon = kwargs.get("epsilon", 1e-4)
self.progress_bar = kwargs.get("progress_bar", True)
self.prior = kwargs.get("prior", None)
self.warmup = kwargs.get("warmup", 100)
Expand Down
Loading

0 comments on commit 9093ec4

Please sign in to comment.