f1d35b4ee525e4a2ef434414268eb050de81da7b,official/nlp/bert_models.py,,classifier_model,#Any#Any#Any#Any#Any#Any#,396

Before Change


    bert_model = hub.KerasLayer(hub_module_url, trainable=True)
    pooled_output, _ = bert_model([input_word_ids, input_mask, input_type_ids])
  else:
    bert_model = modeling.get_bert_model(
        input_word_ids,
        input_mask,
        input_type_ids,
        config=bert_config,
        float_type=float_type)
    pooled_output = bert_model.outputs[0]

  if final_layer_initializer is not None:
    initializer = final_layer_initializer

After Change


        type_vocab_size=bert_config.type_vocab_size,
        initializer=tf.keras.initializers.TruncatedNormal(
            stddev=bert_config.initializer_range))
    return bert_classifier.BertClassifier(
        bert_encoder,
        num_classes=num_labels,
        dropout_rate=bert_config.hidden_dropout_prob,
        initializer=initializer), bert_encoder

  input_word_ids = tf.keras.layers.Input(
      shape=(max_seq_length,), dtype=tf.int32, name="input_word_ids")
  input_mask = tf.keras.layers.Input(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tensorflow/models
Commit Name: f1d35b4ee525e4a2ef434414268eb050de81da7b
Time: 2019-11-11
Author: hongkuny@google.com
File Name: official/nlp/bert_models.py
Class Name:
Method Name: classifier_model


Project Name: tensorflow/models
Commit Name: 553a4f4195fd095f94f45027937e7f25d38cf200
Time: 2019-12-20
Author: chendouble@google.com
File Name: official/nlp/bert/export_tfhub.py
Class Name:
Method Name: create_bert_model


Project Name: tensorflow/models
Commit Name: 83f0a576015953b30bf8a05fc0033983e0d07354
Time: 2019-11-22
Author: chendouble@google.com
File Name: official/nlp/bert_models.py
Class Name:
Method Name: pretrain_model