-
Notifications
You must be signed in to change notification settings - Fork 327
Move Defaults to to end of arg docstring and standardise values
#1848
base: master
Are you sure you want to change the base?
Changes from 5 commits
c5b31ea
9ae3a40
b4c5fb7
3a6ffc8
9cc9478
ecec330
f515646
92a45c7
3ba1d76
38731bf
1b6678d
a45e15b
4ed54cf
9ce9fc1
201819d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,15 +87,14 @@ class OldJitteredResize(BaseImageAugmentationLayer): | |
| This factor is used to scale the input image. | ||
| To replicate the results of the MaskRCNN paper pass `(0.8, 1.25)`. | ||
| crop_size: (Optional) the size of the image to crop from the scaled | ||
| image, defaults to `target_size` when not provided. | ||
| image, when not provided. Defaults to `target_size`. | ||
| bounding_box_format: The format of bounding boxes of input boxes. | ||
| Refer to | ||
| https://github.com/keras-team/keras-cv/blob/master/keras_cv/bounding_box/converters.py | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why drop the github.com prefix? Will GitHub automagically render this link for us in the UI? That would be cool
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ianstenbit Oh actually I think it was flake8 picking up a long line |
||
| keras-team/keras-cv/blob/master/keras_cv/bounding_box/converters.py | ||
| for more details on supported bounding box formats. | ||
| interpolation: String, the interpolation method, defaults to | ||
| `"bilinear"`. Supports `"bilinear"`, `"nearest"`, `"bicubic"`, | ||
| `"area"`, `"lanczos3"`, `"lanczos5"`, `"gaussian"`, | ||
| `"mitchellcubic"`. | ||
| interpolation: String, the interpolation method. Supports `"bilinear"`, | ||
| `"nearest"`, `"bicubic"`, `"area"`, `"lanczos3"`, `"lanczos5"`, | ||
| `"gaussian"`, `"mitchellcubic"`. Defaults to `"bilinear"`. | ||
| seed: (Optional) integer to use as the random seed. | ||
| """ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ | |
| batch size based on the number of accelerators being used. | ||
| """ | ||
|
|
||
| # Try to detect an available TPU. If none is present, defaults to | ||
| # Try to detect an available TPU. If none is present. Defaults to | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's undo this change for all the comments in examples. |
||
| # MirroredStrategy | ||
| try: | ||
| tpu = tf.distribute.cluster_resolver.TPUClusterResolver.connect() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,12 +81,12 @@ def load( | |
| batch_size: how many instances to include in batches after loading. | ||
| Should only be specified if img_size is specified (so that images | ||
| can be resized to the same size before batching). | ||
| shuffle: whether to shuffle the dataset, defaults to True. | ||
| shuffle: whether to shuffle the dataset. Defaults to `True`. | ||
| shuffle_buffer: the size of the buffer to use in shuffling. | ||
| reshuffle_each_iteration: whether to reshuffle the dataset on every | ||
| epoch, defaults to False. | ||
| img_size: the size to resize the images to, defaults to None, indicating | ||
| that images should not be resized. | ||
| epoch. Defaults to `False`. | ||
| img_size: the size to resize the images to, when None, this indicates | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense to me:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I just meant use backticks for |
||
| that images should not be resized. Defaults to `None`. | ||
|
|
||
| Returns: | ||
| tf.data.Dataset containing ImageNet. Each entry is a dictionary | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -484,8 +484,8 @@ def load( | |
| dataset. Defaults to `sbd_train`. | ||
| data_dir: string, local directory path for the loaded data. This will be | ||
| used to download the data file, and unzip. It will be used as a | ||
| cache directory. Defaults to None, and `~/.keras/pascal_voc_2012` | ||
| will be used. | ||
| cache directory. When `None`: `~/.keras/pascal_voc_2012` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe best to just say defaults to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it doesn't default to that value? - It computes to it sure, but defaults to |
||
| will be used. Defaults to `None`. | ||
| """ | ||
| supported_split_value = [ | ||
| "train", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,7 @@ def convert_format(keypoints, source, target, images=None, dtype=None): | |
| Required when transforming from a rel format to a non-rel | ||
| format. | ||
| dtype: the data type to use when transforming the boxes. | ||
| Defaults to None, i.e. `keypoints` dtype. | ||
| When `None` uses a `keypoints` dtype. Defaults to `None`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defaults to the dtype of |
||
| """ | ||
|
|
||
| source = source.lower() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,17 +55,17 @@ class FeaturePyramid(keras.layers.Layer): | |
| max_level: a python int for the highest level of the pyramid for | ||
| feature extraction. | ||
| num_channels: an integer representing the number of channels for the FPN | ||
| operations, defaults to 256. | ||
| operations. Defaults to 256. | ||
| lateral_layers: a python dict with int keys that matches to each of the | ||
| pyramid level. The values of the dict should be `keras.Layer`, which | ||
| will be called with feature activation outputs from backbone at each | ||
| level. Defaults to None, and a `keras.Conv2D` layer with kernel 1x1 | ||
| will be created for each pyramid level. | ||
| level. When None: a `keras.Conv2D` layer with kernel 1x1 | ||
|
||
| will be created for each pyramid level. Defaults to `None`. | ||
| output_layers: a python dict with int keys that matches to each of the | ||
| pyramid level. The values of the dict should be `keras.Layer`, which | ||
| will be called with feature inputs and merged result from upstream | ||
| levels. Defaults to None, and a `keras.Conv2D` layer with kernel 3x3 | ||
| will be created for each pyramid level. | ||
| levels. When `None`: a `keras.Conv2D` layer with kernel 3x3 | ||
| will be created for each pyramid level. Defaults to `None`. | ||
|
|
||
| Sample Usage: | ||
| ```python | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,9 +53,9 @@ class _ROISampler(keras.layers.Layer): | |
| background_class: the background class which is used to map returned the | ||
| sampled ground truth which is classified as background. | ||
| num_sampled_rois: the number of sampled proposals per image for | ||
| further (loss) calculation, defaults to 256. | ||
| further (loss) calculation. Defaults to `256`. | ||
| append_gt_boxes: boolean, whether gt_boxes will be appended to rois | ||
| before sample the rois, defaults to True. | ||
| before sample the rois. Defaults to True. | ||
|
||
| """ # noqa: E501 | ||
|
|
||
| def __init__( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,15 +44,16 @@ class AugMix(BaseImageAugmentationLayer): | |
| `keras_cv.FactorSampler`. A value is sampled from the provided | ||
| range. If a float is passed, the range is interpreted as | ||
| `(0, severity)`. This value represents the level of strength of | ||
| augmentations and is in the range [0, 1]. Defaults to 0.3. | ||
| augmentations and is in the range [0, 1]. Defaults to `0.3`. | ||
| num_chains: an integer representing the number of different chains to | ||
| be mixed, defaults to 3. | ||
| be mixed. Defaults to 3. | ||
| chain_depth: an integer or range representing the number of | ||
| transformations in the chains. If a range is passed, a random | ||
| `chain_depth` value sampled from a uniform distribution over the | ||
| given range is called at the start of the chain. Defaults to [1,3]. | ||
| given range is called at the start of the chain. | ||
| Defaults to `[1,3]`. | ||
| alpha: a float value used as the probability coefficients for the | ||
| Beta and Dirichlet distributions, defaults to 1.0. | ||
| Beta and Dirichlet distributions. Defaults to 1.0. | ||
|
||
| seed: Integer. Used to create a random seed. | ||
|
|
||
| References: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.