def define_activation(df, targets, input_columns, test_blocks, n_samples=None, exclude=None, scale=1):
    """
    Function to build training objects for neural networks from
    a DataFrame
    
    Parameters
    ----------
    df: DataFrame
    
    targets: list of strings
        list of targets (values in df.target)
            
    input_columns: list of strings
        columns to include as inputs
        
    test_blocks: list of numerics
        steps to include
        
    n_samples: int, optional
        exact number of samples to use
        
    exclude: int, optional
        exact number of initial samples to exclude
        
    scale: list of floats, optional
        divisors to scale inputs, one per input column
        
    Returns
    -------
    inputs: list of lists
        inputs[]: list of numeric
            input values
    """
    scale = [
        df[input_column].astype(float).max() for input_column in input_columns
    ]
    inputs = []
    num_targets = len(targets)
    df = df[
        (df.ontarget) &
        (df.step.isin(test_blocks))
    ].copy()
    for i, target in enumerate(targets):
        sample_n = 0
        for row in df[
            df.target==target
        ][input_columns].values.tolist():
            if (exclude and sample_n < exclude):
                sample_n = sample_n + 1
                continue
            elif (
                (not n_samples)
                or
                (sample_n < n_samples)
            ):
                inputs.append(
                    [
                        float(num)/float(
                            scale[row_i]
                        ) for row_i, num in enumerate(row)
                    ]
                )
                sample_n = sample_n + 1
    return(inputs)