-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ktr lite house keeping - revert level knots plot - refine tutorial - refine some plotting code * more house keeping - [x] enhance unit test - [x] relable pool - [x] initializer of ktrlite * notebook update * Update test_ktrlite.py * Update test_ktrlite.py * add comment for stan_extract cleaning Co-authored-by: Zhishi Wang <zhishiw@uber.com>
- Loading branch information
1 parent
04ec959
commit 7f3c923
Showing
11 changed files
with
714 additions
and
343 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,17 @@ | ||
import numpy as np | ||
from ..constants import ktrlite as constants | ||
|
||
|
||
class KTRLiteInitializer(object): | ||
def __init__(self, num_regressor, num_knots_coefficients): | ||
self.num_regressor = num_regressor | ||
self.num_knots_coefficients = num_knots_coefficients | ||
|
||
def __call__(self): | ||
init_values = dict() | ||
if self.num_regressor > 1: | ||
init_values[constants.RegressionSamplingParameters.COEFFICIENTS_KNOT.value] = np.random.normal( | ||
0, 0.1, (self.num_regressor, self.num_knots_coefficients) | ||
) | ||
|
||
return init_values |
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.