tests/functional/branching/black_box.py
def execute():
    """Execute a simple pipeline as an example."""
    # 1. Receive inputs as you want
    parser = argparse.ArgumentParser()
    parser.add_argument("-x", type=float, required=True)
    inputs = parser.parse_args()

    # 2. Perform computations
    y, dy = function(inputs.x)

    # 3. Gather and report results
    results = list()
    results.append(dict(name="example_objective", type="objective", value=y))
    results.append(dict(name="example_gradient", type="gradient", value=[dy]))

    report_results(results)
Execute a simple pipeline as an example.
Execute a simple pipeline as an example.
Execute a simple pipeline as an example .
def execute():
    parser = argparse.ArgumentParser()
    parser.add_argument("-x", type=float, required=True)
    inputs = parser.parse_args()
    y, dy = function(inputs.x)
    results = list()
    results.append(dict(name="example_objective", type="objective", value=y))
    results.append(dict(name="example_gradient", type="gradient", value=[dy]))
    report_results(results)
def execute ( ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( "-x" , type = float , required = True ) inputs = parser . parse_args ( ) y , dy = function ( inputs . x ) results = list ( ) results . append ( dict ( name = "example_objective" , type = "objective" , value = y ) ) results . append ( dict ( name = "example_gradient" , type = "gradient" , value = [ dy ] ) ) report_results ( results )
Execute a simple pipeline as an example.
Execute a simple pipeline as an example .
"""Execute a simple pipeline as an example.""" # 1. Receive inputs as you want # 2. Perform computations # 3. Gather and report results