Skip to content

Getting Started#

Getting started with NePS involves a straightforward yet powerful process, centering around its three main components. This approach ensures flexibility and efficiency in evaluating different architecture and hyperparameter configurations for your problem.

NePS requires Python 3.11 or higher. You can install it via pip or from source.

pip install neural-pipeline-search

The 3 Main Components#

  1. Establish a pipeline_space=:

    class ExampleSpace(neps.PipelineSpace):
        # Define the parameters of your search space
        some_parameter = neps.Float(lower=0.0, upper=1.0)       # float
        another_parameter = neps.Integer(lower=0, upper=10)     # integer
        optimizer = neps.Categorical(choices=("sgd", "adam"))           # categorical
        epoch = neps.IntegerFidelity(lower=1, upper=100)
        learning_rate = neps.Float(lower=1e-5, upper=1, log=True)
        alpha = neps.Float(lower=0.1, upper=1.0, prior=0.99, prior_confidence="high")
    
  2. Define an evaluate_pipeline() function:

    def evaluate_pipeline(some_parameter: float,
                     another_parameter: float,
                     optimizer: str, epoch: int,
                     learning_rate: float, alpha: float) -> float:
        model = make_model(...)
        loss = eval_model(model)
        return loss
    
  3. Execute with neps.run():

    neps.run(evaluate_pipeline, ExampleSpace(), live_plots=True)
    

What's Next?#

The reference section provides detailed information on the individual components of NePS.

  1. How to use the neps.run() function to start the optimization process.
  2. The different search space options available.
  3. How to choose and configure the optimizer used.
  4. How to define the evaluate_pipeline() function.
  5. How to analyze the optimization runs.

Interactive tutorials

Or try NePS hands-on with our tutorials:

  1. Getting Started with HPO: the basic NePS workflow, from a synthetic function to a deep learning task
  2. Defining Search Spaces: parameter types, fidelity parameters, priors, and PipelineSpace classes
  3. Efficient Optimization: multi-fidelity optimization, expert priors, optimizer selection, and parallelization
  4. Multi-Objective Optimization: Multi-objective optimization with PriMO, including per-objective expert priors

Or discover the features of NePS through these practical examples: