Repository: keras-team/keras-nlp

Issue:
Rename `models.Bert()` to `models.BertCustom()`
### Discussed in https://github.com/keras-team/keras-nlp/discussions/305

<div type='discussions-op-text'>

<sup>Originally posted by **jbischof** August 23, 2022</sup>
When prototyping our model API in PR #288 we were following the example of `keras-cv`. They have `DenseNet` and `DenseNet121` and we have `Bert` and `BertBase`. Unfortunately the convention of naming an architecture "base" in NLP makes these names confusing so @mattdangerw and I have discussed changing `models.Bert()` to `models.BertCustom()` for clarity.

I think "custom" is a reasonable modifier to indicate that `BertCustom` is customizable in contrast to `BertBase` and upcoming arches like `BertLarge`. Thoughts?</div>

Discussion:

Patch:
diff --git a/examples/bert/bert_train.py b/examples/bert/bert_train.py
index ff5480f3..3f30b004 100644
--- a/examples/bert/bert_train.py
+++ b/examples/bert/bert_train.py
@@ -407,7 +407,7 @@ def main(_):
 
     with strategy.scope():
         # Create a Bert model the input config.
-        encoder = keras_nlp.models.Bert(
+        encoder = keras_nlp.models.BertCustom(
             vocabulary_size=len(vocab), **model_config
         )
         # Make sure model has been called.
diff --git a/keras_nlp/models/__init__.py b/keras_nlp/models/__init__.py
index 261a563b..703f09ca 100644
--- a/keras_nlp/models/__init__.py
+++ b/keras_nlp/models/__init__.py
@@ -12,6 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from keras_nlp.models.bert import Bert
 from keras_nlp.models.bert import BertBase
 from keras_nlp.models.bert import BertClassifier
+from keras_nlp.models.bert import BertCustom
diff --git a/keras_nlp/models/bert.py b/keras_nlp/models/bert.py
index adaf3d93..143e7618 100644
--- a/keras_nlp/models/bert.py
+++ b/keras_nlp/models/bert.py
@@ -25,7 +25,7 @@ def _bert_kernel_initializer(stddev=0.02):
     return keras.initializers.TruncatedNormal(stddev=stddev)
 
 
-class Bert(keras.Model):
+class BertCustom(keras.Model):
     """Bi-directional Transformer-based encoder network.
 
     This network implements a bi-directional Transformer-based encoder as
@@ -34,7 +34,7 @@ class Bert(keras.Model):
     embedding lookups and transformer layers, but not the masked language model
     or classification task networks.
 
-    This class gives a fully configurable Bert model with any number of layers,
+    This class gives a fully customizable Bert model with any number of layers,
     heads, and embedding dimensions. For specific specific bert architectures
     defined in the paper, see for example `keras_nlp.models.BertBase`.
 
@@ -61,7 +61,7 @@ class Bert(keras.Model):
     Example usage:
     ```python
     # Randomly initialized Bert encoder
-    encoder = keras_nlp.models.Bert(
+    encoder = keras_nlp.models.BertCustom(
         vocabulary_size=30522,
         num_layers=12,
         num_heads=12,
@@ -218,7 +218,7 @@ class BertClassifier(keras.Model):
     """Bert encoder model with a classification head.
 
     Args:
-        base_model: A `keras_nlp.models.Bert` to encode inputs.
+        base_model: A `keras_nlp.models.BertCustom` to encode inputs.
         num_classes: Int. Number of classes to predict.
         name: String, optional. Name of the model.
         trainable: Boolean, optional. If the model's variables should be
@@ -228,7 +228,7 @@ class BertClassifier(keras.Model):
     ```
     python
     # Randomly initialized Bert encoder
-    encoder = keras_nlp.models.Bert(
+    encoder = keras_nlp.models.BertCustom(
         vocabulary_size=30522,
         num_layers=12,
         num_heads=12,
@@ -307,7 +307,7 @@ def BertBase(name=None, trainable=True):
     ```
     """
 
-    model = Bert(
+    model = BertCustom(
         vocabulary_size=30522,
         num_layers=12,
         num_heads=12,


Test patch:
diff --git a/keras_nlp/models/bert_test.py b/keras_nlp/models/bert_test.py
index a329e0f0..e9fd868e 100644
--- a/keras_nlp/models/bert_test.py
+++ b/keras_nlp/models/bert_test.py
@@ -23,7 +23,7 @@ from keras_nlp.models import bert
 
 class BertTest(tf.test.TestCase):
     def test_valid_call_bert(self):
-        model = bert.Bert(
+        model = bert.BertCustom(
             vocabulary_size=30522,
             num_layers=12,
             num_heads=12,
@@ -46,7 +46,7 @@ class BertTest(tf.test.TestCase):
         model(input_data)
 
     def test_valid_call_classifier(self):
-        model = bert.Bert(
+        model = bert.BertCustom(
             vocabulary_size=30522,
             num_layers=12,
             num_heads=12,
@@ -81,7 +81,7 @@ class BertTest(tf.test.TestCase):
         model(input_data)
 
     def test_saving_model(self):
-        model = bert.Bert(
+        model = bert.BertCustom(
             vocabulary_size=30522,
             num_layers=12,
             num_heads=12,