{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/9696","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/9696/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/9696/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/9696/events","html_url":"https://github.com/tensorflow/tensorflow/issues/9696","id":226650147,"number":9696,"title":"Epoch is not working properly for tensorflow keras -  KerasRegressor","user":{"login":"kishorenayar","id":10724627,"avatar_url":"https://avatars0.githubusercontent.com/u/10724627?v=3","gravatar_id":"","url":"https://api.github.com/users/kishorenayar","html_url":"https://github.com/kishorenayar","followers_url":"https://api.github.com/users/kishorenayar/followers","following_url":"https://api.github.com/users/kishorenayar/following{/other_user}","gists_url":"https://api.github.com/users/kishorenayar/gists{/gist_id}","starred_url":"https://api.github.com/users/kishorenayar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishorenayar/subscriptions","organizations_url":"https://api.github.com/users/kishorenayar/orgs","repos_url":"https://api.github.com/users/kishorenayar/repos","events_url":"https://api.github.com/users/kishorenayar/events{/privacy}","received_events_url":"https://api.github.com/users/kishorenayar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"fchollet","id":710255,"avatar_url":"https://avatars0.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"assignees":[{"login":"fchollet","id":710255,"avatar_url":"https://avatars0.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-05-05T18:09:58Z","updated_at":"2017-05-05T20:30:53Z","closed_at":"2017-05-05T20:30:53Z","body":"I'm just getting start with Keras using tensorflow, In the code code I have specified **nb_epoch=100** but it's not running for 100 epoch, instead it's executing only for 10 epoch. I wonder is there any bug in my code. Also attaching the output in the bottom\r\n\r\n**Code:**\r\n\r\n```python\r\n\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.model_selection import train_test_split\r\nimport sklearn.metrics as metrics\r\nfrom utils import encode_numeric_zscore, to_xy\r\n\r\ndataset = pd.read_csv('data/boston-housing.csv', dtype=np.float32)\r\n\r\nfor col in dataset.columns:\r\n    if col != 'medv':\r\n        encode_numeric_zscore(dataset, col)\r\n\r\nfeatures, target = to_xy(dataset, 'medv')\r\n\r\nX_train, X_test, Y_train, Y_test = train_test_split(features, target, test_size=0.25, random_state=42)\r\n\r\n\r\ndef chart_regression(pred, y):\r\n    t = pd.DataFrame({'pred': pred, 'y': Y_test.flatten()})\r\n    t.sort_values(by=['y'], inplace=True)\r\n    a = plt.plot(t['y'].tolist(), label='expected')\r\n    b = plt.plot(t['pred'].tolist(), label='prediction')\r\n    plt.ylabel('output')\r\n    plt.legend()\r\n    plt.show()\r\n\r\n\r\nfrom tensorflow.contrib.keras.api.keras.models import Sequential\r\nfrom tensorflow.contrib.keras.api.keras.layers import Dense, Dropout\r\n\r\n\r\ndef build_nn():\r\n    model = Sequential()\r\n    model.add(Dense(75, input_shape=(13,), activation=\"relu\", kernel_initializer=\"glorot_uniform\"))\r\n    model.add(Dense(55, activation=\"relu\"))\r\n    model.add(Dropout(0.005))\r\n    model.add(Dense(35, activation=\"relu\"))\r\n    model.add(Dropout(0.005))\r\n    model.add(Dense(11, activation=\"relu\"))\r\n    model.add(Dropout(0.005))\r\n    model.add(Dense(1, activation='relu', kernel_initializer=\"normal\"))\r\n    model.compile(loss='mean_squared_error', optimizer='adam')\r\n    return model\r\n\r\n\r\nseed = 7\r\nnp.random.seed(seed)\r\n\r\nfrom tensorflow.contrib.keras.api.keras.wrappers.scikit_learn import KerasRegressor\r\n\r\nregressor = KerasRegressor(build_fn=build_nn, nb_epoch=100, batch_size=1, verbose=1)\r\n\r\nregressor.fit(X_train, Y_train)\r\n\r\nprediction = regressor.predict(X_test, batch_size=1)\r\n\r\nscore = metrics.mean_squared_error(Y_test, prediction)\r\n\r\nprint('\\n')\r\n\r\nprint(\"Final score (MSE): {}\".format(score))\r\n\r\nprint('\\n')\r\n\r\nscore = np.sqrt(metrics.mean_squared_error(prediction, Y_test))\r\nprint(\"Final score (RMSE): {}\".format(score))\r\n\r\nchart_regression(prediction, Y_test)\r\n```\r\n\r\n**Output:**\r\n\r\n```\r\nEpoch 1/10\r\n2017-05-05 15:30:37.711608: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.711981: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.712355: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.712721: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.713094: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.713463: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.713839: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.\r\n2017-05-05 15:30:37.714213: W c:\\tf_jenkins\\home\\workspace\\release-win\\device\\cpu\\os\\windows\\tensorflow\\core\\platform\\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.\r\n  1/379 [..............................] - ETA: 107s - loss: 492.8400\r\n 60/379 [===>..........................] - ETA: 1s - loss: 669.9998  \r\n109/379 [=======>......................] - ETA: 0s - loss: 625.8113\r\n172/379 [============>.................] - ETA: 0s - loss: 461.0169\r\n233/379 [=================>............] - ETA: 0s - loss: 353.9863\r\n286/379 [=====================>........] - ETA: 0s - loss: 294.3637\r\n336/379 [=========================>....] - ETA: 0s - loss: 254.4181\r\n379/379 [==============================] - 0s - loss: 230.0349     \r\nEpoch 2/10\r\n  1/379 [..............................] - ETA: 0s - loss: 8.0337\r\n 55/379 [===>..........................] - ETA: 0s - loss: 26.7809\r\n104/379 [=======>......................] - ETA: 0s - loss: 22.0314\r\n171/379 [============>.................] - ETA: 0s - loss: 25.4361\r\n219/379 [================>.............] - ETA: 0s - loss: 28.0947\r\n285/379 [=====================>........] - ETA: 0s - loss: 26.3540\r\n338/379 [=========================>....] - ETA: 0s - loss: 26.1902\r\n379/379 [==============================] - 0s - loss: 24.4095     \r\nEpoch 3/10\r\n  1/379 [..............................] - ETA: 0s - loss: 9.8365\r\n 42/379 [==>...........................] - ETA: 0s - loss: 20.2841\r\n108/379 [=======>......................] - ETA: 0s - loss: 16.0308\r\n161/379 [===========>..................] - ETA: 0s - loss: 18.4792\r\n225/379 [================>.............] - ETA: 0s - loss: 18.9558\r\n288/379 [=====================>........] - ETA: 0s - loss: 16.6939\r\n379/379 [==============================] - 0s - loss: 18.3086     \r\nEpoch 4/10\r\n  1/379 [..............................] - ETA: 0s - loss: 13.7463\r\n 59/379 [===>..........................] - ETA: 0s - loss: 12.0900\r\n115/379 [========>.....................] - ETA: 0s - loss: 18.4202\r\n181/379 [=============>................] - ETA: 0s - loss: 16.6087\r\n244/379 [==================>...........] - ETA: 0s - loss: 15.0061\r\n302/379 [======================>.......] - ETA: 0s - loss: 13.2268\r\n379/379 [==============================] - 0s - loss: 16.0613     \r\nEpoch 5/10\r\n  1/379 [..............................] - ETA: 0s - loss: 25.8912\r\n 65/379 [====>.........................] - ETA: 0s - loss: 28.8039\r\n123/379 [========>.....................] - ETA: 0s - loss: 21.3528\r\n199/379 [==============>...............] - ETA: 0s - loss: 17.8586\r\n256/379 [===================>..........] - ETA: 0s - loss: 19.4171\r\n327/379 [========================>.....] - ETA: 0s - loss: 17.9864\r\n379/379 [==============================] - 0s - loss: 18.2714     \r\nEpoch 6/10\r\n  1/379 [..............................] - ETA: 0s - loss: 2.0872\r\n 61/379 [===>..........................] - ETA: 0s - loss: 18.4408\r\n115/379 [========>.....................] - ETA: 0s - loss: 16.9127\r\n184/379 [=============>................] - ETA: 0s - loss: 16.9419\r\n247/379 [==================>...........] - ETA: 0s - loss: 16.2630\r\n314/379 [=======================>......] - ETA: 0s - loss: 14.9947\r\n379/379 [==============================] - 0s - loss: 13.5761     \r\nEpoch 7/10\r\n  1/379 [..............................] - ETA: 0s - loss: 0.3704\r\n 59/379 [===>..........................] - ETA: 0s - loss: 15.2191\r\n118/379 [========>.....................] - ETA: 0s - loss: 11.8381\r\n188/379 [=============>................] - ETA: 0s - loss: 10.9623\r\n247/379 [==================>...........] - ETA: 0s - loss: 10.0409\r\n313/379 [=======================>......] - ETA: 0s - loss: 12.4478\r\n379/379 [==============================] - 0s - loss: 13.8573     \r\nEpoch 8/10\r\n  1/379 [..............................] - ETA: 0s - loss: 1.2173\r\n 44/379 [==>...........................] - ETA: 0s - loss: 12.5116\r\n 96/379 [======>.......................] - ETA: 0s - loss: 10.2578\r\n170/379 [============>.................] - ETA: 0s - loss: 11.9057\r\n227/379 [================>.............] - ETA: 0s - loss: 12.1961\r\n287/379 [=====================>........] - ETA: 0s - loss: 14.4951\r\n341/379 [=========================>....] - ETA: 0s - loss: 13.7772\r\n379/379 [==============================] - 0s - loss: 13.2340     \r\nEpoch 9/10\r\n  1/379 [..............................] - ETA: 0s - loss: 0.1982\r\n 53/379 [===>..........................] - ETA: 0s - loss: 9.8250\r\n124/379 [========>.....................] - ETA: 0s - loss: 9.8112\r\n175/379 [============>.................] - ETA: 0s - loss: 10.9075\r\n238/379 [=================>............] - ETA: 0s - loss: 11.3589\r\n303/379 [======================>.......] - ETA: 0s - loss: 13.8970\r\n379/379 [==============================] - 0s - loss: 14.5469     \r\nEpoch 10/10\r\n  1/379 [..............................] - ETA: 0s - loss: 3.7164\r\n 49/379 [==>...........................] - ETA: 0s - loss: 14.6596\r\n116/379 [========>.....................] - ETA: 0s - loss: 15.5960\r\n172/379 [============>.................] - ETA: 0s - loss: 13.6525\r\n223/379 [================>.............] - ETA: 0s - loss: 12.9588\r\n275/379 [====================>.........] - ETA: 0s - loss: 12.4905\r\n347/379 [==========================>...] - ETA: 0s - loss: 13.5629\r\n379/379 [==============================] - 0s - loss: 13.1696     \r\n  1/127 [..............................] - ETA: 1s\r\n\r\nFinal score (MSE): 11.964310646057129\r\n\r\n\r\nFinal score (RMSE): 3.458946466445923\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/299568275","html_url":"https://github.com/tensorflow/tensorflow/issues/9696#issuecomment-299568275","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/9696","id":299568275,"user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars0.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T20:30:53Z","updated_at":"2017-05-05T20:30:53Z","body":"You should use the keyword `epochs`, not `nb_epochs` (which is deprecated)."}}
{"actor":{"display_login":"fchollet"}}