How to use the elephas.hyperparam.HyperasWorker function in elephas

To help you get started, we’ve selected a few elephas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maxpumperla / elephas / elephas / hyperparam.py View on Github external
def compute_trials(self, model, data, max_evals, notebook_name):
        model_string = get_hyperopt_model_string(model=model, data=data, functions=None, notebook_name=notebook_name,
                                                 verbose=False, stack=3)
        hyperas_worker = HyperasWorker(model_string, max_evals)
        dummy_rdd = self.spark_context.parallelize([i for i in range(1, 1000)])
        dummy_rdd = dummy_rdd.repartition(self.num_workers)
        trials_list = dummy_rdd.mapPartitions(
            hyperas_worker._minimize).collect()

        return trials_list