Skip to content

Commit 9f9ac46

Browse files
authored
File-level Doc-string Changes for Classifiers and Presets (#604)
* Some file-level doc-string fixes * Remove defaults from dropout values in classifier
1 parent 1c8817e commit 9f9ac46

13 files changed

+24
-16
lines changed

keras_nlp/models/bert/bert_classifier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""BERT task specific models and heads."""
14+
"""BERT classification model."""
1515

1616
import copy
1717
import os
@@ -50,8 +50,8 @@ class BertClassifier(PipelineModel):
5050
Args:
5151
backbone: A `keras_nlp.models.BertBackbone` instance.
5252
num_classes: int. Number of classes to predict.
53-
dropout: float, defaults to 0.1. The dropout probability value, applied
54-
after the dense layer.
53+
dropout: float. The dropout probability value, applied after the dense
54+
layer.
5555
preprocessor: A `keras_nlp.models.BertPreprocessor` or `None`. If
5656
`None`, this model will not apply preprocessing, and inputs should
5757
be preprocessed before calling the model.

keras_nlp/models/bert/bert_classifier_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Tests for BERT task specific models and heads."""
14+
"""Tests for BERT classification model."""
1515

1616
import os
1717

keras_nlp/models/bert/bert_presets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""BERT model preset configurations."""
1415

1516
# TODO(jbischof): document presets in keras.io and use URL in docstrings
1617
# Metadata for loading pretrained model weights.

keras_nlp/models/distil_bert/distil_bert_classifier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""DistilBERT task specific models and heads."""
14+
"""DistilBERT classification model."""
1515

1616
import copy
1717

@@ -53,8 +53,8 @@ class DistilBertClassifier(PipelineModel):
5353
backbone: A `keras_nlp.models.DistilBert` instance.
5454
num_classes: int. Number of classes to predict.
5555
hidden_dim: int. The size of the pooler layer.
56-
dropout: float, defaults to 0.2. The dropout probability value, applied
57-
after the first dense layer.
56+
dropout: float. The dropout probability value, applied after the first
57+
dense layer.
5858
preprocessor: A `keras_nlp.models.DistilBertPreprocessor` or `None`. If
5959
`None`, this model will not apply preprocessing, and inputs should
6060
be preprocessed before calling the model.

keras_nlp/models/distil_bert/distil_bert_classifier_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Tests for DistilBERT task specific models and heads."""
14+
"""Tests for DistilBERT classification model."""
1515

1616
import os
1717

keras_nlp/models/distil_bert/distil_bert_presets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""DistilBERT model preset configurations."""
15+
1416
backbone_presets = {
1517
"distil_bert_base_en_uncased": {
1618
"config": {

keras_nlp/models/gpt2/gpt2_presets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""GPT-2 model preset configurations."""
1415

1516
# Metadata for loading pretrained model weights.
1617
backbone_presets = {

keras_nlp/models/roberta/roberta_classifier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""RoBERTa task specific models and heads."""
14+
"""RoBERTa classification model."""
1515

1616
import copy
1717

@@ -49,8 +49,8 @@ class RobertaClassifier(PipelineModel):
4949
backbone: A `keras_nlp.models.RobertaBackbone` instance.
5050
num_classes: int. Number of classes to predict.
5151
hidden_dim: int. The size of the pooler layer.
52-
dropout: float, defaults to 0.0. The dropout probability value, applied
53-
to the pooled output, and after the first dense layer.
52+
dropout: float. The dropout probability value, applied to the pooled
53+
output, and after the first dense layer.
5454
preprocessor: A `keras_nlp.models.BertPreprocessor` or `None`. If
5555
`None`, this model will not apply preprocessing, and inputs should
5656
be preprocessed before calling the model.

keras_nlp/models/roberta/roberta_classifier_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Tests for RoBERTa task specific models and heads."""
14+
"""Tests for RoBERTa classification model."""
1515

1616
import os
1717

keras_nlp/models/roberta/roberta_presets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""RoBERTa model preset configurations."""
15+
1416
backbone_presets = {
1517
"roberta_base": {
1618
"config": {

0 commit comments

Comments
 (0)