Skip to content

Commit 778e39f

Browse files
authored
Merge pull request #1429 from rstudio/retether-3.2.1
Retether 3.2.1
2 parents b7a381d + 113354c commit 778e39f

File tree

1,449 files changed

+8365
-5856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,449 files changed

+8365
-5856
lines changed

.tether/man/InputLayer.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,4 @@ class InputLayer(keras.src.layers.layer.Layer)
4242
| dtype
4343
| Alias of `layer.variable_dtype`.
4444
|
45-
| ----------------------------------------------------------------------
46-
| Data and other attributes defined here:
47-
|
48-
| __annotations__ = {}
49-
|
5045

.tether/man/Layer.txt

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
218218
| initializer,
219219
| dtype=None,
220220
| trainable=True,
221+
| autocast=True,
221222
| regularizer=None,
222223
| constraint=None,
223224
| name=None
@@ -232,36 +233,41 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
232233
| initializer=None,
233234
| dtype=None,
234235
| trainable=True,
236+
| autocast=True,
235237
| regularizer=None,
236238
| constraint=None,
239+
| aggregation='mean',
237240
| name=None
238241
| )
239242
| Add a weight variable to the layer.
240243
|
241244
| Args:
242-
| shape: Shape tuple for the variable.
243-
| Must be fully-defined (no `None` entries).
244-
| Defaults to `()` (scalar) if unspecified.
245-
| initializer: Initializer object to use to
246-
| populate the initial variable value,
247-
| or string name of a built-in initializer
248-
| (e.g. `"random_normal"`). If unspecified,
249-
| defaults to `"glorot_uniform"`
250-
| for floating-point variables and to `"zeros"`
245+
| shape: Shape tuple for the variable. Must be fully-defined
246+
| (no `None` entries). Defaults to `()` (scalar) if unspecified.
247+
| initializer: Initializer object to use to populate the initial
248+
| variable value, or string name of a built-in initializer
249+
| (e.g. `"random_normal"`). If unspecified, defaults to
250+
| `"glorot_uniform"` for floating-point variables and to `"zeros"`
251251
| for all other types (e.g. int, bool).
252-
| dtype: Dtype of the variable to create,
253-
| e.g. `"float32"`. If unspecified,
254-
| defaults to the layer's
255-
| variable dtype (which itself defaults to
256-
| `"float32"` if unspecified).
257-
| trainable: Boolean, whether the variable should
258-
| be trainable via backprop or whether its
259-
| updates are managed manually.
260-
| constraint: Contrainst object to call on the
261-
| variable after any optimizer update,
262-
| or string name of a built-in constraint.
263-
| name: String name of the variable. Useful
264-
| for debugging purposes.
252+
| dtype: Dtype of the variable to create, e.g. `"float32"`. If
253+
| unspecified, defaults to the layer's variable dtype
254+
| (which itself defaults to `"float32"` if unspecified).
255+
| trainable: Boolean, whether the variable should be trainable via
256+
| backprop or whether its updates are managed manually. Defaults
257+
| to `True`.
258+
| autocast: Boolean, whether to autocast layers variables when
259+
| accessing them. Defaults to `True`.
260+
| regularizer: Regularizer object to call to apply penalty on the
261+
| weight. These penalties are summed into the loss function
262+
| during optimization. Defaults to `None`.
263+
| constraint: Contrainst object to call on the variable after any
264+
| optimizer update, or string name of a built-in constraint.
265+
| Defaults to `None`.
266+
| aggregation: String, one of `'mean'`, `'sum'`,
267+
| `'only_first_replica'`. Annotates the variable with the type
268+
| of multi-replica aggregation to be used for this variable
269+
| when writing custom data parallel training loops.
270+
| name: String name of the variable. Useful for debugging purposes.
265271
|
266272
| build(self, input_shape)
267273
|
@@ -490,9 +496,4 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
490496
| trainable
491497
| Settable boolean, whether this layer should be trainable or not.
492498
|
493-
| ----------------------------------------------------------------------
494-
| Data and other attributes defined here:
495-
|
496-
| __annotations__ = {}
497-
|
498499

.tether/man/Metric.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Metric(builtins.object)
99
| name: (Optional) string name of the metric instance.
1010
| dtype: (Optional) data type of the metric result.
1111
|
12-
| Standalone usage:
12+
| Example:
1313
|
1414
| ```python
1515
| m = SomeMetric(...)
@@ -111,6 +111,7 @@ class Metric(builtins.object)
111111
| shape,
112112
| initializer,
113113
| dtype=None,
114+
| aggregation='sum',
114115
| name=None
115116
| )
116117
|

.tether/man/activation_hard_sigmoid.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Hard sigmoid activation function.
55

66
The hard sigmoid activation is defined as:
77

8-
- `0` if `if x < -2.5`
9-
- `1` if `x > 2.5`
10-
- `0.2 * x + 0.5` if `-2.5 <= x <= 2.5`
8+
- `0` if `if x <= -3`
9+
- `1` if `x >= 3`
10+
- `(x/6) + 0.5` if `-3 < x < 3`
1111

1212
It's a faster, piecewise linear approximation
1313
of the sigmoid activation.
@@ -18,3 +18,4 @@ Args:
1818
Reference:
1919

2020
- [Wikipedia "Hard sigmoid"](https://en.wikipedia.org/wiki/Hard_sigmoid)
21+

.tether/man/callback_remote_monitor.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class RemoteMonitor(keras.src.callbacks.callback.Callback)
1818
| path: String; path relative to `root` to which the events will be sent.
1919
| field: String; JSON field under which the data will be stored.
2020
| The field is used only if the payload is sent within a form
21-
| (i.e. send_as_json is set to False).
21+
| (i.e. when `send_as_json=False`).
2222
| headers: Dictionary; optional custom HTTP headers.
2323
| send_as_json: Boolean; whether the request should be
2424
| sent as `"application/json"`.
@@ -58,3 +58,4 @@ class RemoteMonitor(keras.src.callbacks.callback.Callback)
5858
| the `Model`'s metrics are returned. Example:
5959
| `{'loss': 0.2, 'accuracy': 0.7}`.
6060
|
61+

.tether/man/callback_tensorboard.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ class TensorBoard(keras.src.callbacks.callback.Callback)
7777
|
7878
| Examples:
7979
|
80-
| Basic usage:
81-
|
8280
| ```python
8381
| tensorboard_callback = keras.callbacks.TensorBoard(log_dir="./logs")
8482
| model.fit(x_train, y_train, epochs=2, callbacks=[tensorboard_callback])
@@ -266,3 +264,4 @@ class TensorBoard(keras.src.callbacks.callback.Callback)
266264
|
267265
| summary
268266
|
267+

.tether/man/export_savedmodel.keras.src.models.model.Model.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ keras.Model.export(
55
format='tf_saved_model'
66
)
77
__doc__
8-
[TF backend only]* Create a TF SavedModel artifact for inference
9-
(e.g. via TF-Serving).
8+
Create a TF SavedModel artifact for inference.
109

11-
**Note:** This can currently only be used with the TF backend.
10+
**Note:** This can currently only be used with
11+
the TensorFlow or JAX backends.
1212

1313
This method lets you export a model to a lightweight SavedModel artifact
1414
that contains the model's forward pass only (its `call()` method)

.tether/man/image_from_array.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keras.utils.array_to_img(
88
__doc__
99
Converts a 3D NumPy array to a PIL Image instance.
1010

11-
Usage:
11+
Example:
1212

1313
```python
1414
from PIL import Image
@@ -30,3 +30,4 @@ Args:
3030

3131
Returns:
3232
A PIL Image instance.
33+

.tether/man/image_load.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ keras.utils.load_img(
99
__doc__
1010
Loads an image into PIL format.
1111

12-
Usage:
12+
Example:
1313

1414
```python
1515
image = keras.utils.load_img(image_path)
@@ -37,3 +37,4 @@ Args:
3737

3838
Returns:
3939
A PIL Image instance.
40+

.tether/man/image_to_array.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keras.utils.img_to_array(
77
__doc__
88
Converts a PIL Image instance to a NumPy array.
99

10-
Usage:
10+
Example:
1111

1212
```python
1313
from PIL import Image
@@ -28,3 +28,4 @@ Args:
2828

2929
Returns:
3030
A 3D NumPy array.
31+

0 commit comments

Comments
 (0)