     nematus->save(graph, name);
   };
 
-
-  auto trainSets = options["trainsets"].as<std::vector<std::string>>();
-  auto vocabs = options["vocabs"].as<std::vector<std::string>>();
-  size_t maxSentenceLength = options["max-length"].as<size_t>();
+  auto trainSets = options.get<std::vector<std::string>>("trainsets");
+  auto vocabs = options.get<std::vector<std::string>>("vocabs");
+  size_t maxSentenceLength = options.get<size_t>("max-length");
 
   auto corpus = New<Corpus>(trainSets, vocabs, dimVocabs, maxSentenceLength);
   auto bg = New<BatchGenerator<Corpus>>(corpus, dimBatch, dimMaxiBatch);

        samples += batch->size();
        wordsDisp += batch->words();
        batches++;
        if(options["after-batches"].as<size_t>()
           && batches >= options["after-batches"].as<size_t>())
          break;

        if(batches % options["disp-freq"].as<size_t>() == 0) {
          std::stringstream ss;
          ss << "Ep. " << epochs
             << " : Up. " << batches
             << " : Sen. " << samples
             << " : Cost " << std::fixed << std::setprecision(2)
                           << costSum / options["disp-freq"].as<size_t>()
             << " : Time " << timer.format(2, "%ws");

          float seconds = std::stof(timer.format(5, "%w"));

    nematus->load(graph, modelInit);
  }

  graph->reserveWorkspaceMB(options.get<size_t>("workspace"));

  Ptr<ClipperBase> clipper = nullptr;

  float clipNorm = options.get<double>("clip-norm");
  float lrate = options.get<double>("lrate");
  if(clipNorm > 0)
    clipper = Clipper<Norm>(clipNorm);
  auto opt = Optimizer<Adam>(lrate, clip=clipper);
