Move methods in cinnabar.stats concerning MLE to the MLEEstimator class#211
Move methods in cinnabar.stats concerning MLE to the MLEEstimator class#211ianmkenney wants to merge 10 commits into
Conversation
|
pre-commit.ci autofix |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #211 +/- ##
=======================================
Coverage 97.23% 97.24%
=======================================
Files 22 22
Lines 2027 2032 +5
=======================================
+ Hits 1971 1976 +5
Misses 56 56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
| ) | ||
|
|
||
| @staticmethod | ||
| def mle(graph: nx.DiGraph, factor: str = "f_ij", node_factor: Union[str, None] = None) -> (np.ndarray, np.ndarray): |
There was a problem hiding this comment.
We are free to change this however we want, lets update the factor and node_factor names to be more meaningful or if you think its okay we can leave them.
| # populate the edges of the graph along with their computational binding free energies | ||
| for m in filter(lambda m: m.computational, measurements): | ||
| if isinstance(m.labelA, ReferenceState): | ||
| # TODO this is never hit in the tests and should be supported behavior |
There was a problem hiding this comment.
Good point lets move this to another PR we should be able to support absolute computational values in the solver as well!
| z[i] += -deltaij / varij | ||
| z[j] += deltaij / varij | ||
|
|
||
| F_matrix[i, i] += 1 / varij | ||
| F_matrix[j, j] += 1 / varij | ||
| F_matrix[i, j] += -1 / varij | ||
| F_matrix[j, i] += -1 / varij |
There was a problem hiding this comment.
Nice this should allow for the forward and backward results do you want to add support for that in this PR? We have some example data in #133 so we can add a test we can punt to another if you want though.
| return f_i, Finv | ||
|
|
||
| @staticmethod | ||
| def form_edge_matrix(graph: nx.Graph, label: str, step=None, action=None, node_label=None) -> np.ndarray: |
There was a problem hiding this comment.
Lets just remove this if its not needed anymore and all tests associated with it!
jthorton
left a comment
There was a problem hiding this comment.
Looking great just a couple of things to look at.
No description provided.