-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging-robust' of github.com:BasisResearch/causal_pyro…
… into ra-eb-dr-reproduce
- Loading branch information
Showing
10 changed files
with
716 additions
and
280 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import Any, Callable, Optional | ||
|
||
from typing_extensions import Concatenate | ||
|
||
from chirho.robust.ops import Functional, P, Point, S, T, influence_fn | ||
|
||
|
||
def one_step_correction( | ||
model: Callable[P, Any], | ||
guide: Callable[P, Any], | ||
functional: Optional[Functional[P, S]] = None, | ||
**influence_kwargs, | ||
) -> Callable[Concatenate[Point[T], P], S]: | ||
influence_kwargs_one_step = influence_kwargs.copy() | ||
influence_kwargs_one_step["pointwise_influence"] = False | ||
eif_fn = influence_fn(model, guide, functional, **influence_kwargs_one_step) | ||
|
||
def _one_step(test_data: Point[T], *args, **kwargs) -> S: | ||
return eif_fn(test_data, *args, **kwargs) | ||
|
||
return _one_step |
This file contains 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
Oops, something went wrong.