Skip to content

Getting Started#

Getting started with ScaleFM 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.

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

pip install scalefm

The 3 Main Components#

  1. Establish a pipeline_space=:

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

    def evaluate_pipeline(some_parameter: float,
                    another_parameter: float,
                    optimizer: str, epoch: int,
                    learning_rate: float, alpha: float) -> dict:
        model = make_model(...)
        loss = eval_model(model)
        return {"objective_to_minimize": loss, "cost": training_flops(model)}
    
  3. Execute with scalefm.acquire():

    scalefm.acquire(evaluate_pipeline, ExampleSpace(), live_plots=True)
    

What's Next?#

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

  1. How to use the scalefm.acquire() 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 tutorial

Or try ScaleFM hands-on with the ScaleFM Demo, a basic demo of the pipeline, the visualization and the parallelisation of the runs.

Or discover the features of ScaleFM through these practical examples: