Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions examples/workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@
"# 2. Output dimensionality: 5\n",
"# With these parameters, we obtain the following vector in the DataFrame column: [0,0,0,1,0]\n",
"\n",
"transformer = OneHotTransformer(output_dim=nb_classes, input_col=\"label_index\", output_col=\"label\")\n",
"transformer = OneHotTransformer(output_dim=nb_classes, input_col=\"label_index\", output_col=\"label_out\")\n",
"dataset = transformer.transform(dataset)\n",
"# Only select the columns we need (less data shuffling) while training.\n",
"dataset = dataset.select(\"features_normalized\", \"label_index\", \"label\")\n",
"dataset = dataset.select(\"features_normalized\", \"label_index\", \"label_out\")\n",
"\n",
"# Show the expected output vectors of the neural network.\n",
"dataset.select(\"label_index\", \"label\").take(1)"
"dataset.select(\"label_index\", \"label_out\").take(1)"
]
},
{
Expand Down Expand Up @@ -597,7 +597,7 @@
" # Allocate a Distributed Keras Accuracy evaluator.\n",
" evaluator = AccuracyEvaluator(prediction_col=\"prediction_index\", label_col=\"label_index\")\n",
" # Clear the prediction column from the testset.\n",
" test_set = test_set.select(\"features_normalized\", \"label_index\", \"label\")\n",
" test_set = test_set.select(\"features_normalized\", \"label_index\", \"label_out\")\n",
" # Apply a prediction from a trained model.\n",
" predictor = ModelPredictor(keras_model=trained_model, features_col=\"features_normalized\")\n",
" test_set = predictor.predict(test_set)\n",
Expand Down Expand Up @@ -674,7 +674,7 @@
"source": [
"trainer = SingleTrainer(keras_model=model, worker_optimizer=optimizer,\n",
" loss=loss, features_col=\"features_normalized\",\n",
" label_col=\"label\", num_epoch=1, batch_size=32)\n",
" label_col=\"label_out\", num_epoch=1, batch_size=32)\n",
"trained_model = trainer.train(training_set)"
]
},
Expand Down Expand Up @@ -718,7 +718,7 @@
"outputs": [],
"source": [
"trainer = AEASGD(keras_model=model, worker_optimizer=optimizer, loss=loss, num_workers=num_workers, \n",
" batch_size=32, features_col=\"features_normalized\", label_col=\"label\", num_epoch=1,\n",
" batch_size=32, features_col=\"features_normalized\", label_col=\"label_out\", num_epoch=1,\n",
" communication_window=32, rho=5.0, learning_rate=0.1)\n",
"trainer.set_parallelism_factor(1)\n",
"trained_model = trainer.train(training_set)"
Expand Down Expand Up @@ -762,7 +762,7 @@
"outputs": [],
"source": [
"trainer = EAMSGD(keras_model=model, worker_optimizer=optimizer, loss=loss, num_workers=num_workers,\n",
" batch_size=32, features_col=\"features_normalized\", label_col=\"label\", num_epoch=1,\n",
" batch_size=32, features_col=\"features_normalized\", label_col=\"label_out\", num_epoch=1,\n",
" communication_window=32, rho=5.0, learning_rate=0.1, momentum=0.6)\n",
"trainer.set_parallelism_factor(1)\n",
"trained_model = trainer.train(training_set)"
Expand Down Expand Up @@ -800,7 +800,7 @@
"source": [
"trainer = DOWNPOUR(keras_model=model, worker_optimizer=optimizer, loss=loss, num_workers=num_workers,\n",
" batch_size=32, communication_window=5, learning_rate=0.05, num_epoch=1,\n",
" features_col=\"features_normalized\", label_col=\"label\")\n",
" features_col=\"features_normalized\", label_col=\"label_out\")\n",
"trainer.set_parallelism_factor(1)\n",
"trained_model = trainer.train(training_set)"
]
Expand Down