Commit 838339f6 authored by Chen Chen's avatar Chen Chen Committed by A. Unique TensorFlower
Browse files

Update fine_tuning_bert.ipynb colab to use tf-models-official==2.4.0 and use...

Update fine_tuning_bert.ipynb colab to use tf-models-official==2.4.0 and use the new checkpoint and tfhub model.

PiperOrigin-RevId: 357219857
parent 2e398eca
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "vXLA5InzXydn" "id": "vXLA5InzXydn"
}, },
"source": [ "source": [
...@@ -15,8 +14,6 @@ ...@@ -15,8 +14,6 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"cellView": "form", "cellView": "form",
"colab": {},
"colab_type": "code",
"id": "RuRlpLL-X0R_" "id": "RuRlpLL-X0R_"
}, },
"outputs": [], "outputs": [],
...@@ -37,7 +34,6 @@ ...@@ -37,7 +34,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "1mLJmVotXs64" "id": "1mLJmVotXs64"
}, },
"source": [ "source": [
...@@ -47,7 +43,6 @@ ...@@ -47,7 +43,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "hYEwGTeCXnnX" "id": "hYEwGTeCXnnX"
}, },
"source": [ "source": [
...@@ -73,7 +68,6 @@ ...@@ -73,7 +68,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "YN2ACivEPxgD" "id": "YN2ACivEPxgD"
}, },
"source": [ "source": [
...@@ -85,7 +79,6 @@ ...@@ -85,7 +79,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "s2d9S2CSSO1z" "id": "s2d9S2CSSO1z"
}, },
"source": [ "source": [
...@@ -95,7 +88,6 @@ ...@@ -95,7 +88,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "fsACVQpVSifi" "id": "fsACVQpVSifi"
}, },
"source": [ "source": [
...@@ -110,19 +102,16 @@ ...@@ -110,19 +102,16 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "NvNr2svBM-p3" "id": "NvNr2svBM-p3"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install -q tf-models-official==2.3.0" "!pip install -q tf-models-official==2.4.0"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "U-7qPCjWUAyy" "id": "U-7qPCjWUAyy"
}, },
"source": [ "source": [
...@@ -133,8 +122,6 @@ ...@@ -133,8 +122,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "lXsXev5MNr20" "id": "lXsXev5MNr20"
}, },
"outputs": [], "outputs": [],
...@@ -163,13 +150,12 @@ ...@@ -163,13 +150,12 @@
"import official.nlp.data.classifier_data_lib\n", "import official.nlp.data.classifier_data_lib\n",
"import official.nlp.modeling.losses\n", "import official.nlp.modeling.losses\n",
"import official.nlp.modeling.models\n", "import official.nlp.modeling.models\n",
"import official.nlp.modeling.networks" "import official.nlp.modeling.networks\n"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "mbanlzTvJBsz" "id": "mbanlzTvJBsz"
}, },
"source": [ "source": [
...@@ -179,7 +165,6 @@ ...@@ -179,7 +165,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "PpW0x8TpR8DT" "id": "PpW0x8TpR8DT"
}, },
"source": [ "source": [
...@@ -190,20 +175,17 @@ ...@@ -190,20 +175,17 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "vzRHOLciR8eq" "id": "vzRHOLciR8eq"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"gs_folder_bert = \"gs://cloud-tpu-checkpoints/bert/keras_bert/uncased_L-12_H-768_A-12\"\n", "gs_folder_bert = \"gs://cloud-tpu-checkpoints/bert/v3/uncased_L-12_H-768_A-12\"\n",
"tf.io.gfile.listdir(gs_folder_bert)" "tf.io.gfile.listdir(gs_folder_bert)"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "9uFskufsR2LT" "id": "9uFskufsR2LT"
}, },
"source": [ "source": [
...@@ -214,19 +196,16 @@ ...@@ -214,19 +196,16 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "e0dAkUttJAzj" "id": "e0dAkUttJAzj"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"hub_url_bert = \"https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/2\"" "hub_url_bert = \"https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/3\""
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "Qv6abtRvH4xO" "id": "Qv6abtRvH4xO"
}, },
"source": [ "source": [
...@@ -239,7 +218,6 @@ ...@@ -239,7 +218,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "28DvUhC1YUiB" "id": "28DvUhC1YUiB"
}, },
"source": [ "source": [
...@@ -257,8 +235,6 @@ ...@@ -257,8 +235,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "Ijikx5OsH9AT" "id": "Ijikx5OsH9AT"
}, },
"outputs": [], "outputs": [],
...@@ -272,8 +248,6 @@ ...@@ -272,8 +248,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "xf9zz4vLYXjr" "id": "xf9zz4vLYXjr"
}, },
"outputs": [], "outputs": [],
...@@ -284,7 +258,6 @@ ...@@ -284,7 +258,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "ZgBg2r2nYT-K" "id": "ZgBg2r2nYT-K"
}, },
"source": [ "source": [
...@@ -295,8 +268,6 @@ ...@@ -295,8 +268,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "IQrHxv7W7jH5" "id": "IQrHxv7W7jH5"
}, },
"outputs": [], "outputs": [],
...@@ -307,7 +278,6 @@ ...@@ -307,7 +278,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "vhsVWYNxazz5" "id": "vhsVWYNxazz5"
}, },
"source": [ "source": [
...@@ -318,8 +288,6 @@ ...@@ -318,8 +288,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "n0gfc_VTayfQ" "id": "n0gfc_VTayfQ"
}, },
"outputs": [], "outputs": [],
...@@ -330,7 +298,6 @@ ...@@ -330,7 +298,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "38zJcap6xkbC" "id": "38zJcap6xkbC"
}, },
"source": [ "source": [
...@@ -341,8 +308,6 @@ ...@@ -341,8 +308,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "xON_i6SkwApW" "id": "xON_i6SkwApW"
}, },
"outputs": [], "outputs": [],
...@@ -356,7 +321,6 @@ ...@@ -356,7 +321,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "9fbTyfJpNr7x" "id": "9fbTyfJpNr7x"
}, },
"source": [ "source": [
...@@ -366,7 +330,6 @@ ...@@ -366,7 +330,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "wqeN54S61ZKQ" "id": "wqeN54S61ZKQ"
}, },
"source": [ "source": [
...@@ -381,8 +344,6 @@ ...@@ -381,8 +344,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "idxyhmrCQcw5" "id": "idxyhmrCQcw5"
}, },
"outputs": [], "outputs": [],
...@@ -398,7 +359,6 @@ ...@@ -398,7 +359,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "zYHDSquU2lDU" "id": "zYHDSquU2lDU"
}, },
"source": [ "source": [
...@@ -409,8 +369,6 @@ ...@@ -409,8 +369,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "L_OfOYPg853R" "id": "L_OfOYPg853R"
}, },
"outputs": [], "outputs": [],
...@@ -424,7 +382,6 @@ ...@@ -424,7 +382,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "kkAXLtuyWWDI" "id": "kkAXLtuyWWDI"
}, },
"source": [ "source": [
...@@ -438,7 +395,6 @@ ...@@ -438,7 +395,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "62UTWLQd9-LB" "id": "62UTWLQd9-LB"
}, },
"source": [ "source": [
...@@ -451,8 +407,6 @@ ...@@ -451,8 +407,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "bdL-dRNRBRJT" "id": "bdL-dRNRBRJT"
}, },
"outputs": [], "outputs": [],
...@@ -463,7 +417,6 @@ ...@@ -463,7 +417,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "UrPktnqpwqie" "id": "UrPktnqpwqie"
}, },
"source": [ "source": [
...@@ -474,8 +427,6 @@ ...@@ -474,8 +427,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "BR7BmtU498Bh" "id": "BR7BmtU498Bh"
}, },
"outputs": [], "outputs": [],
...@@ -495,8 +446,6 @@ ...@@ -495,8 +446,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "has42aUdfky-" "id": "has42aUdfky-"
}, },
"outputs": [], "outputs": [],
...@@ -508,7 +457,6 @@ ...@@ -508,7 +457,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "MU9lTWy_xXbb" "id": "MU9lTWy_xXbb"
}, },
"source": [ "source": [
...@@ -519,8 +467,6 @@ ...@@ -519,8 +467,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "USD8uihw-g4J" "id": "USD8uihw-g4J"
}, },
"outputs": [], "outputs": [],
...@@ -533,7 +479,6 @@ ...@@ -533,7 +479,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "xmNv4l4k-dBZ" "id": "xmNv4l4k-dBZ"
}, },
"source": [ "source": [
...@@ -543,7 +488,6 @@ ...@@ -543,7 +488,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "DIWjNIKq-ldh" "id": "DIWjNIKq-ldh"
}, },
"source": [ "source": [
...@@ -556,7 +500,6 @@ ...@@ -556,7 +500,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "ulNZ4U96-8JZ" "id": "ulNZ4U96-8JZ"
}, },
"source": [ "source": [
...@@ -567,8 +510,6 @@ ...@@ -567,8 +510,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "EezOO9qj91kP" "id": "EezOO9qj91kP"
}, },
"outputs": [], "outputs": [],
...@@ -581,7 +522,6 @@ ...@@ -581,7 +522,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "rxLenwAvCkBf" "id": "rxLenwAvCkBf"
}, },
"source": [ "source": [
...@@ -592,8 +532,6 @@ ...@@ -592,8 +532,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "2CetH_5C9P2m" "id": "2CetH_5C9P2m"
}, },
"outputs": [], "outputs": [],
...@@ -609,7 +547,6 @@ ...@@ -609,7 +547,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "P5UBnCn8Ii6s" "id": "P5UBnCn8Ii6s"
}, },
"source": [ "source": [
...@@ -622,8 +559,6 @@ ...@@ -622,8 +559,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "sDGiWYPLEd5a" "id": "sDGiWYPLEd5a"
}, },
"outputs": [], "outputs": [],
...@@ -666,8 +601,6 @@ ...@@ -666,8 +601,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "yuLKxf6zHxw-" "id": "yuLKxf6zHxw-"
}, },
"outputs": [], "outputs": [],
...@@ -685,7 +618,6 @@ ...@@ -685,7 +618,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "7FC5aLVxKVKK" "id": "7FC5aLVxKVKK"
}, },
"source": [ "source": [
...@@ -696,8 +628,6 @@ ...@@ -696,8 +628,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "jyjTdGpFhO_1" "id": "jyjTdGpFhO_1"
}, },
"outputs": [], "outputs": [],
...@@ -711,7 +641,6 @@ ...@@ -711,7 +641,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "FSwymsbkbLDA" "id": "FSwymsbkbLDA"
}, },
"source": [ "source": [
...@@ -721,7 +650,6 @@ ...@@ -721,7 +650,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "Efrj3Cn1kLAp" "id": "Efrj3Cn1kLAp"
}, },
"source": [ "source": [
...@@ -731,7 +659,6 @@ ...@@ -731,7 +659,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "xxpOY5r2Ayq6" "id": "xxpOY5r2Ayq6"
}, },
"source": [ "source": [
...@@ -742,8 +669,6 @@ ...@@ -742,8 +669,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "ujapVfZ_AKW7" "id": "ujapVfZ_AKW7"
}, },
"outputs": [], "outputs": [],
...@@ -761,7 +686,6 @@ ...@@ -761,7 +686,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "96ldxDSwkVkj" "id": "96ldxDSwkVkj"
}, },
"source": [ "source": [
...@@ -774,8 +698,6 @@ ...@@ -774,8 +698,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "cH682__U0FBv" "id": "cH682__U0FBv"
}, },
"outputs": [], "outputs": [],
...@@ -787,7 +709,6 @@ ...@@ -787,7 +709,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "XqKp3-5GIZlw" "id": "XqKp3-5GIZlw"
}, },
"source": [ "source": [
...@@ -798,8 +719,6 @@ ...@@ -798,8 +719,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "bAQblMIjwkvx" "id": "bAQblMIjwkvx"
}, },
"outputs": [], "outputs": [],
...@@ -810,7 +729,6 @@ ...@@ -810,7 +729,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "sFmVG4SKZAw8" "id": "sFmVG4SKZAw8"
}, },
"source": [ "source": [
...@@ -821,8 +739,6 @@ ...@@ -821,8 +739,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "VTjgPbp4ZDKo" "id": "VTjgPbp4ZDKo"
}, },
"outputs": [], "outputs": [],
...@@ -837,7 +753,6 @@ ...@@ -837,7 +753,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "Q0NTdwZsQK8n" "id": "Q0NTdwZsQK8n"
}, },
"source": [ "source": [
...@@ -850,8 +765,6 @@ ...@@ -850,8 +765,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "8L__-erBwLIQ" "id": "8L__-erBwLIQ"
}, },
"outputs": [], "outputs": [],
...@@ -862,7 +775,6 @@ ...@@ -862,7 +775,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "mKAvkQc3heSy" "id": "mKAvkQc3heSy"
}, },
"source": [ "source": [
...@@ -875,21 +787,18 @@ ...@@ -875,21 +787,18 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "97Ll2Gichd_Y" "id": "97Ll2Gichd_Y"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"checkpoint = tf.train.Checkpoint(model=bert_encoder)\n", "checkpoint = tf.train.Checkpoint(encoder=bert_encoder)\n",
"checkpoint.restore(\n", "checkpoint.read(\n",
" os.path.join(gs_folder_bert, 'bert_model.ckpt')).assert_consumed()" " os.path.join(gs_folder_bert, 'bert_model.ckpt')).assert_consumed()"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "2oHOql35k3Dd" "id": "2oHOql35k3Dd"
}, },
"source": [ "source": [
...@@ -899,7 +808,6 @@ ...@@ -899,7 +808,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "115caFLMk-_l" "id": "115caFLMk-_l"
}, },
"source": [ "source": [
...@@ -913,8 +821,6 @@ ...@@ -913,8 +821,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "w8qXKRZuCwW4" "id": "w8qXKRZuCwW4"
}, },
"outputs": [], "outputs": [],
...@@ -937,7 +843,6 @@ ...@@ -937,7 +843,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "pXRGxiRNEHS2" "id": "pXRGxiRNEHS2"
}, },
"source": [ "source": [
...@@ -948,8 +853,6 @@ ...@@ -948,8 +853,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "eQNA16bhDpky" "id": "eQNA16bhDpky"
}, },
"outputs": [], "outputs": [],
...@@ -960,7 +863,6 @@ ...@@ -960,7 +863,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "xqu_K71fJQB8" "id": "xqu_K71fJQB8"
}, },
"source": [ "source": [
...@@ -970,7 +872,6 @@ ...@@ -970,7 +872,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "78FEUOOEkoP0" "id": "78FEUOOEkoP0"
}, },
"source": [ "source": [
...@@ -980,7 +881,6 @@ ...@@ -980,7 +881,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "OTNcA0O0nSq9" "id": "OTNcA0O0nSq9"
}, },
"source": [ "source": [
...@@ -991,8 +891,6 @@ ...@@ -991,8 +891,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "nzi8hjeTQTRs" "id": "nzi8hjeTQTRs"
}, },
"outputs": [], "outputs": [],
...@@ -1015,7 +913,6 @@ ...@@ -1015,7 +913,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "IFtKFWbNKb0u" "id": "IFtKFWbNKb0u"
}, },
"source": [ "source": [
...@@ -1028,8 +925,6 @@ ...@@ -1028,8 +925,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "9ZoUgDUNJPz3" "id": "9ZoUgDUNJPz3"
}, },
"outputs": [], "outputs": [],
...@@ -1049,7 +944,6 @@ ...@@ -1049,7 +944,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "7ynJibkBRTJF" "id": "7ynJibkBRTJF"
}, },
"source": [ "source": [
...@@ -1060,8 +954,6 @@ ...@@ -1060,8 +954,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "umo0ttrgRYIM" "id": "umo0ttrgRYIM"
}, },
"outputs": [], "outputs": [],
...@@ -1076,8 +968,6 @@ ...@@ -1076,8 +968,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "utGl0M3aZCE4" "id": "utGl0M3aZCE4"
}, },
"outputs": [], "outputs": [],
...@@ -1088,7 +978,6 @@ ...@@ -1088,7 +978,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "fVo_AnT0l26j" "id": "fVo_AnT0l26j"
}, },
"source": [ "source": [
...@@ -1101,8 +990,6 @@ ...@@ -1101,8 +990,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "Nl5x6nElZqkP" "id": "Nl5x6nElZqkP"
}, },
"outputs": [], "outputs": [],
...@@ -1115,8 +1002,7 @@ ...@@ -1115,8 +1002,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {}, "collapsed": true,
"colab_type": "code",
"id": "y_ACvKPsVUXC" "id": "y_ACvKPsVUXC"
}, },
"outputs": [], "outputs": [],
...@@ -1137,7 +1023,6 @@ ...@@ -1137,7 +1023,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "eQceYqRFT_Eg" "id": "eQceYqRFT_Eg"
}, },
"source": [ "source": [
...@@ -1147,7 +1032,6 @@ ...@@ -1147,7 +1032,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "SaC1RlFawUpc" "id": "SaC1RlFawUpc"
}, },
"source": [ "source": [
...@@ -1158,7 +1042,6 @@ ...@@ -1158,7 +1042,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "CwUdjFBkzUgh" "id": "CwUdjFBkzUgh"
}, },
"source": [ "source": [
...@@ -1170,7 +1053,6 @@ ...@@ -1170,7 +1053,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "2UTQrkyOT5wD" "id": "2UTQrkyOT5wD"
}, },
"source": [ "source": [
...@@ -1181,8 +1063,6 @@ ...@@ -1181,8 +1063,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "XQeDFOzYR9Z9" "id": "XQeDFOzYR9Z9"
}, },
"outputs": [], "outputs": [],
...@@ -1195,7 +1075,6 @@ ...@@ -1195,7 +1075,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "XrFQbfErUWxa" "id": "XrFQbfErUWxa"
}, },
"source": [ "source": [
...@@ -1206,8 +1085,6 @@ ...@@ -1206,8 +1085,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "ymw7GOHpSHKU" "id": "ymw7GOHpSHKU"
}, },
"outputs": [], "outputs": [],
...@@ -1234,7 +1111,6 @@ ...@@ -1234,7 +1111,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "uX_Sp-wTUoRm" "id": "uX_Sp-wTUoRm"
}, },
"source": [ "source": [
...@@ -1245,8 +1121,6 @@ ...@@ -1245,8 +1121,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "rkHxIK57SQ_r" "id": "rkHxIK57SQ_r"
}, },
"outputs": [], "outputs": [],
...@@ -1267,7 +1141,6 @@ ...@@ -1267,7 +1141,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "stbaVouogvzS" "id": "stbaVouogvzS"
}, },
"source": [ "source": [
...@@ -1278,8 +1151,6 @@ ...@@ -1278,8 +1151,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "gwhrlQl4gxVF" "id": "gwhrlQl4gxVF"
}, },
"outputs": [], "outputs": [],
...@@ -1290,7 +1161,6 @@ ...@@ -1290,7 +1161,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "dbJ76vSJj77j" "id": "dbJ76vSJj77j"
}, },
"source": [ "source": [
...@@ -1300,7 +1170,6 @@ ...@@ -1300,7 +1170,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "9J95LFRohiYw" "id": "9J95LFRohiYw"
}, },
"source": [ "source": [
...@@ -1311,8 +1180,6 @@ ...@@ -1311,8 +1180,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "gCvaLLAxPuMc" "id": "gCvaLLAxPuMc"
}, },
"outputs": [], "outputs": [],
...@@ -1356,8 +1223,6 @@ ...@@ -1356,8 +1223,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "rutkBadrhzdR" "id": "rutkBadrhzdR"
}, },
"outputs": [], "outputs": [],
...@@ -1384,8 +1249,6 @@ ...@@ -1384,8 +1249,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "59TVgt4Z7fuU" "id": "59TVgt4Z7fuU"
}, },
"outputs": [], "outputs": [],
...@@ -1396,7 +1259,6 @@ ...@@ -1396,7 +1259,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "QbklKt-w_CiI" "id": "QbklKt-w_CiI"
}, },
"source": [ "source": [
...@@ -1411,8 +1273,6 @@ ...@@ -1411,8 +1273,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "GDWrHm0BGpbX" "id": "GDWrHm0BGpbX"
}, },
"outputs": [], "outputs": [],
...@@ -1426,8 +1286,6 @@ ...@@ -1426,8 +1286,6 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"cellView": "form", "cellView": "form",
"colab": {},
"colab_type": "code",
"id": "Y29meH0qGq_5" "id": "Y29meH0qGq_5"
}, },
"outputs": [], "outputs": [],
...@@ -1439,13 +1297,11 @@ ...@@ -1439,13 +1297,11 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "lo6479At4sP1" "id": "lo6479At4sP1"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"hub_encoder = hub.KerasLayer(f\"https://tfhub.dev/tensorflow/{hub_model_name}/2\",\n", "hub_encoder = hub.KerasLayer(f\"https://tfhub.dev/tensorflow/{hub_model_name}/3\",\n",
" trainable=True)\n", " trainable=True)\n",
"\n", "\n",
"print(f\"The Hub encoder has {len(hub_encoder.trainable_variables)} trainable variables\")" "print(f\"The Hub encoder has {len(hub_encoder.trainable_variables)} trainable variables\")"
...@@ -1454,7 +1310,6 @@ ...@@ -1454,7 +1310,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "iTzF574wivQv" "id": "iTzF574wivQv"
}, },
"source": [ "source": [
...@@ -1465,27 +1320,25 @@ ...@@ -1465,27 +1320,25 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "XEcYrCR45Uwo" "id": "XEcYrCR45Uwo"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"result = hub_encoder(\n", "result = hub_encoder(\n",
" inputs=[glue_train['input_word_ids'][:10],\n", " inputs=dict(\n",
" glue_train['input_mask'][:10],\n", " input_word_ids=glue_train['input_word_ids'][:10],\n",
" glue_train['input_type_ids'][:10],],\n", " input_mask=glue_train['input_mask'][:10],\n",
" input_type_ids=glue_train['input_type_ids'][:10],),\n",
" training=False,\n", " training=False,\n",
")\n", ")\n",
"\n", "\n",
"print(\"Pooled output shape:\", result[0].shape)\n", "print(\"Pooled output shape:\", result['pooled_output'].shape)\n",
"print(\"Sequence output shape:\", result[1].shape)" "print(\"Sequence output shape:\", result['sequence_output'].shape)"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "cjojn8SmLSRI" "id": "cjojn8SmLSRI"
}, },
"source": [ "source": [
...@@ -1498,33 +1351,31 @@ ...@@ -1498,33 +1351,31 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "9nTDaApyLR70" "id": "9nTDaApyLR70"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"hub_classifier, hub_encoder = bert.bert_models.classifier_model(\n", "hub_classifier = nlp.modeling.models.BertClassifier(\n",
" # Caution: Most of `bert_config` is ignored if you pass a hub url.\n", " bert_encoder,\n",
" bert_config=bert_config, hub_module_url=hub_url_bert, num_labels=2)" " num_classes=2,\n",
" dropout_rate=0.1,\n",
" initializer=tf.keras.initializers.TruncatedNormal(\n",
" stddev=0.02))"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "xMJX3wV0_v7I" "id": "xMJX3wV0_v7I"
}, },
"source": [ "source": [
"The one downside to loading this model from TFHub is that the structure of internal keras layers is not restored. So it's more difficult to inspect or modify the model. The `TransformerEncoder` model is now a single layer:" "The one downside to loading this model from TFHub is that the structure of internal keras layers is not restored. So it's more difficult to inspect or modify the model. The `BertEncoder` model is now a single layer:"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "pD71dnvhM2QS" "id": "pD71dnvhM2QS"
}, },
"outputs": [], "outputs": [],
...@@ -1536,8 +1387,6 @@ ...@@ -1536,8 +1387,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "nLZD-isBzNKi" "id": "nLZD-isBzNKi"
}, },
"outputs": [], "outputs": [],
...@@ -1552,7 +1401,6 @@ ...@@ -1552,7 +1401,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "ZxSqH0dNAgXV" "id": "ZxSqH0dNAgXV"
}, },
"source": [ "source": [
...@@ -1560,13 +1408,12 @@ ...@@ -1560,13 +1408,12 @@
"\n", "\n",
"### Low level model building\n", "### Low level model building\n",
"\n", "\n",
"If you need a more control over the construction of the model it's worth noting that the `classifier_model` function used earlier is really just a thin wrapper over the `nlp.modeling.networks.TransformerEncoder` and `nlp.modeling.models.BertClassifier` classes. Just remember that if you start modifying the architecture it may not be correct or possible to reload the pre-trained checkpoint so you'll need to retrain from scratch." "If you need a more control over the construction of the model it's worth noting that the `classifier_model` function used earlier is really just a thin wrapper over the `nlp.modeling.networks.BertEncoder` and `nlp.modeling.models.BertClassifier` classes. Just remember that if you start modifying the architecture it may not be correct or possible to reload the pre-trained checkpoint so you'll need to retrain from scratch."
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "0cgABEwDj06P" "id": "0cgABEwDj06P"
}, },
"source": [ "source": [
...@@ -1577,43 +1424,38 @@ ...@@ -1577,43 +1424,38 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "5r_yqhBFSVEM" "id": "5r_yqhBFSVEM"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"transformer_config = config_dict.copy()\n", "bert_encoder_config = config_dict.copy()\n",
"\n", "\n",
"# You need to rename a few fields to make this work:\n", "# You need to rename a few fields to make this work:\n",
"transformer_config['attention_dropout_rate'] = transformer_config.pop('attention_probs_dropout_prob')\n", "bert_encoder_config['attention_dropout_rate'] = bert_encoder_config.pop('attention_probs_dropout_prob')\n",
"transformer_config['activation'] = tf_utils.get_activation(transformer_config.pop('hidden_act'))\n", "bert_encoder_config['activation'] = tf_utils.get_activation(bert_encoder_config.pop('hidden_act'))\n",
"transformer_config['dropout_rate'] = transformer_config.pop('hidden_dropout_prob')\n", "bert_encoder_config['dropout_rate'] = bert_encoder_config.pop('hidden_dropout_prob')\n",
"transformer_config['initializer'] = tf.keras.initializers.TruncatedNormal(\n", "bert_encoder_config['initializer'] = tf.keras.initializers.TruncatedNormal(\n",
" stddev=transformer_config.pop('initializer_range'))\n", " stddev=bert_encoder_config.pop('initializer_range'))\n",
"transformer_config['max_sequence_length'] = transformer_config.pop('max_position_embeddings')\n", "bert_encoder_config['max_sequence_length'] = bert_encoder_config.pop('max_position_embeddings')\n",
"transformer_config['num_layers'] = transformer_config.pop('num_hidden_layers')\n", "bert_encoder_config['num_layers'] = bert_encoder_config.pop('num_hidden_layers')\n",
"\n", "\n",
"transformer_config" "bert_encoder_config"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "rIO8MI7LLijh" "id": "rIO8MI7LLijh"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"manual_encoder = nlp.modeling.networks.TransformerEncoder(**transformer_config)" "manual_encoder = nlp.modeling.networks.BertEncoder(**bert_encoder_config)"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "4a4tFSg9krRi" "id": "4a4tFSg9krRi"
}, },
"source": [ "source": [
...@@ -1624,21 +1466,18 @@ ...@@ -1624,21 +1466,18 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "X6N9NEqfXJCx" "id": "X6N9NEqfXJCx"
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"checkpoint = tf.train.Checkpoint(model=manual_encoder)\n", "checkpoint = tf.train.Checkpoint(encoder=manual_encoder)\n",
"checkpoint.restore(\n", "checkpoint.read(\n",
" os.path.join(gs_folder_bert, 'bert_model.ckpt')).assert_consumed()" " os.path.join(gs_folder_bert, 'bert_model.ckpt')).assert_consumed()"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "1BPiPO4ykuwM" "id": "1BPiPO4ykuwM"
}, },
"source": [ "source": [
...@@ -1649,8 +1488,6 @@ ...@@ -1649,8 +1488,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "hlVdgJKmj389" "id": "hlVdgJKmj389"
}, },
"outputs": [], "outputs": [],
...@@ -1664,7 +1501,6 @@ ...@@ -1664,7 +1501,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "nJMXvVgJkyBv" "id": "nJMXvVgJkyBv"
}, },
"source": [ "source": [
...@@ -1675,8 +1511,6 @@ ...@@ -1675,8 +1511,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "tQX57GJ6wkAb" "id": "tQX57GJ6wkAb"
}, },
"outputs": [], "outputs": [],
...@@ -1684,17 +1518,14 @@ ...@@ -1684,17 +1518,14 @@
"manual_classifier = nlp.modeling.models.BertClassifier(\n", "manual_classifier = nlp.modeling.models.BertClassifier(\n",
" bert_encoder,\n", " bert_encoder,\n",
" num_classes=2,\n", " num_classes=2,\n",
" dropout_rate=transformer_config['dropout_rate'],\n", " dropout_rate=bert_encoder_config['dropout_rate'],\n",
" initializer=tf.keras.initializers.TruncatedNormal(\n", " initializer=bert_encoder_config['initializer'])"
" stddev=bert_config.initializer_range))"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "kB-nBWhQk0dS" "id": "kB-nBWhQk0dS"
}, },
"outputs": [], "outputs": [],
...@@ -1705,7 +1536,6 @@ ...@@ -1705,7 +1536,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "E6AJlOSyIO1L" "id": "E6AJlOSyIO1L"
}, },
"source": [ "source": [
...@@ -1720,8 +1550,6 @@ ...@@ -1720,8 +1550,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "28Dv3BPRlFTD" "id": "28Dv3BPRlFTD"
}, },
"outputs": [], "outputs": [],
...@@ -1733,7 +1561,6 @@ ...@@ -1733,7 +1561,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "LRjcHr0UlT8c" "id": "LRjcHr0UlT8c"
}, },
"source": [ "source": [
...@@ -1746,8 +1573,6 @@ ...@@ -1746,8 +1573,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "MHY8K6kDngQn" "id": "MHY8K6kDngQn"
}, },
"outputs": [], "outputs": [],
...@@ -1765,8 +1590,7 @@ ...@@ -1765,8 +1590,7 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {}, "collapsed": true,
"colab_type": "code",
"id": "wKIcSprulu3P" "id": "wKIcSprulu3P"
}, },
"outputs": [], "outputs": [],
...@@ -1782,7 +1606,6 @@ ...@@ -1782,7 +1606,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "IMTC_gfAl_PZ" "id": "IMTC_gfAl_PZ"
}, },
"source": [ "source": [
...@@ -1793,8 +1616,6 @@ ...@@ -1793,8 +1616,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "YRt3VTmBmCBY" "id": "YRt3VTmBmCBY"
}, },
"outputs": [], "outputs": [],
...@@ -1816,7 +1637,6 @@ ...@@ -1816,7 +1637,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text",
"id": "l8D9Lv3Bn740" "id": "l8D9Lv3Bn740"
}, },
"source": [ "source": [
...@@ -1827,8 +1647,6 @@ ...@@ -1827,8 +1647,6 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"colab": {},
"colab_type": "code",
"id": "2Hf2rpRXk89N" "id": "2Hf2rpRXk89N"
}, },
"outputs": [], "outputs": [],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment