layers
Custom layers that are needed for the various models.
- bpreveal.layers.linearRegression(**kwargs)
A linear regression layer that’s compatible with shap.
Implements the following formula:
out = input * slope + offset
where slope and offset are two (scalar) parameters.
Note that although this is a function, it behaves like a normal Keras layer class and you create it like this:
regression = bpreveal.layers.LinearRegression(name="oct4_regression")(regressionInput)
- Parameters:
kwargs – Passed to the keras Layer initializer.
- Returns:
A function that you can call with a Keras layer as input, like a normal Keras Layer class.
- Return type:
A function taking a tensor and returning a tensor.