experiments.experiment_utils¶
Utilities used in the rest of the library
Functions
|
Run model forward pass in batches. |
|
Run model forward pass in batches for the custom regime. |
|
Utility function for reinforcement learning to generate new episodes using the behavior policy to use in each trial. |
|
Calculate the expected discounted return by generating episodes |
|
Condition for whether a value of g is unsafe. |
|
Load the episodes generatd for each experiment trial. |
|
Utility function for supervised learning to generate the resampled datasets to use in each trial. |
|
Convenience function for figuring out the number of epochs necessary to ensure that at each data fraction, the total number of iterations (and batch size) will stay fixed. |
Convenience function for figuring out the number of epochs necessary to ensure that the number of iterations for each data frac is: max(niter_min,# of iterations such that each sample is seen num_repeat times) |
|
|
Utility function for preparing data and sensitive attributes for the custom regime for a given trial with n_points (given data frac) |
|
Utility function for preparing features and labels for a given fairlearn trial. |
|
Utility function for preparing features and labels for a given trial with n_points (given data frac) |
|
Utility function for preparing features and labels for a given baseline trial. |
|
Utility function for setting up the spec object to use for a Seldonian algorithm trial |
|
A common initial solution function used in supervised learning. |
|
Convenience function for parallel processing that chunks up the data fractions and trial indices as arguments for use in the map function of a ProcessPoolExecutor. |