Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc fix on keras models #3585

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 18 additions & 9 deletions deepchem/models/keras_model.py
Expand Up @@ -353,7 +353,8 @@ def fit(self,

Returns
-------
The average loss over the most recent checkpoint interval
float
The average loss over the most recent checkpoint interval
"""
return self.fit_generator(
self.default_generator(dataset,
Expand Down Expand Up @@ -403,7 +404,8 @@ def fit_generator(self,

Returns
-------
The average loss over the most recent checkpoint interval
float
The average loss over the most recent checkpoint interval
"""
if not isinstance(callbacks, SequenceCollection):
callbacks = [callbacks]
Expand Down Expand Up @@ -557,7 +559,8 @@ def fit_on_batch(self,

Returns
-------
the loss on the batch
float
the loss on the batch
"""
self._ensure_built()
dataset = NumpyDataset(X, y, w)
Expand Down Expand Up @@ -738,7 +741,10 @@ def predict_on_generator(
If specified, all outputs of this type will be retrieved
from the model. If output_types is specified, outputs must
be None.
Returns:

Returns
-------
OneOrMany[np.ndarray]
a NumPy array of the model produces a single output, or a list of arrays
if it produces multiple outputs
"""
Expand Down Expand Up @@ -768,8 +774,9 @@ def predict_on_batch(

Returns
-------
a NumPy array of the model produces a single output, or a list of arrays
if it produces multiple outputs
OneOrMany[np.ndarray]
a NumPy array of the model produces a single output, or a list of arrays
if it produces multiple outputs
"""
dataset = NumpyDataset(X=X, y=None)
return self.predict(dataset, transformers, outputs)
Expand Down Expand Up @@ -797,9 +804,11 @@ def predict_uncertainty_on_batch(

Returns
-------
for each output, a tuple (y_pred, y_std) where y_pred is the predicted
value of the output, and each element of y_std estimates the standard
deviation of the corresponding element of y_pred
OneOrMany[Tuple[y_pred, y_std]]
y_pred: np.ndarray
predicted value of the output
y_std: np.ndarray
standard deviation of the corresponding element of y_pred
"""
dataset = NumpyDataset(X=X, y=None)
return self.predict_uncertainty(dataset, masks)
Expand Down