brainstorm/tools.py
def evaluate(network, iter, scorers=(), out_name='', targets_name='targets',
             mask_name=None):
    """Evaluate one or more scores for a network.

    This tool can be used to evaluate scores of a trained network on test
    data.

    Args:
        network (brainstorm.structure.Network): Network to be evaluated.
        iter (brainstorm.DataIterator): A data iterator which produces the
                                        data on which the scores are computed.
        scorers (tuple[brainstorm.scorers.Scorer]): A list or tuple of Scorers.
        out_name (Optional[str]): Name of the network output which is scored
                                  against the targets.
        targets_name (Optional[str]): Name of the targets data provided by the
                                      data iterator (``iter``).
        mask_name (Optional[str]): Name of the mask data  provided by the
                                   data iterator (``iter``).
    """
    iterator = iter(handler=network.handler)
    scores = {scorer.__name__: [] for scorer in scorers}
    for n in network.get_loss_values():
        scores[n] = []

    for _ in run_network(network, iterator):
        network.forward_pass()
        gather_losses_and_scores(
            network, scorers, scores, out_name=out_name,
            targets_name=targets_name, mask_name=mask_name)

    return aggregate_losses_and_scores(scores, network, scorers)
Evaluate one or more scores for a network.

    This tool can be used to evaluate scores of a trained network on test
    data.

    Args:
        network (brainstorm.structure.Network): Network to be evaluated.
        iter (brainstorm.DataIterator): A data iterator which produces the
                                        data on which the scores are computed.
        scorers (tuple[brainstorm.scorers.Scorer]): A list or tuple of Scorers.
        out_name (Optional[str]): Name of the network output which is scored
                                  against the targets.
        targets_name (Optional[str]): Name of the targets data provided by the
                                      data iterator (``iter``).
        mask_name (Optional[str]): Name of the mask data  provided by the
                                   data iterator (``iter``).
    
Evaluate one or more scores for a network.
This tool can be used to evaluate scores of a trained network on test
data.
Evaluate one or more scores for a network . This tool can be used to evaluate scores of a trained network on test data .
def evaluate(network, iter, scorers=(), out_name='', targets_name='targets',
             mask_name=None):
    iterator = iter(handler=network.handler)
    scores = {scorer.__name__: [] for scorer in scorers}
    for n in network.get_loss_values():
        scores[n] = []
    for _ in run_network(network, iterator):
        network.forward_pass()
        gather_losses_and_scores(
            network, scorers, scores, out_name=out_name,
            targets_name=targets_name, mask_name=mask_name)
    return aggregate_losses_and_scores(scores, network, scorers)
def evaluate ( network , iter , scorers = ( ) , out_name = '' , targets_name = 'targets' , mask_name = None ) : iterator = iter ( handler = network . handler ) scores = { scorer . __name__ : [ ] for scorer in scorers } for n in network . get_loss_values ( ) : scores [ n ] = [ ] for _ in run_network ( network , iterator ) : network . forward_pass ( ) gather_losses_and_scores ( network , scorers , scores , out_name = out_name , targets_name = targets_name , mask_name = mask_name ) return aggregate_losses_and_scores ( scores , network , scorers )
Evaluate one or more scores for a network.
Evaluate one or more scores for a network .
"""Evaluate one or more scores for a network.

    This tool can be used to evaluate scores of a trained network on test
    data.

    Args:
        network (brainstorm.structure.Network): Network to be evaluated.
        iter (brainstorm.DataIterator): A data iterator which produces the
                                        data on which the scores are computed.
        scorers (tuple[brainstorm.scorers.Scorer]): A list or tuple of Scorers.
        out_name (Optional[str]): Name of the network output which is scored
                                  against the targets.
        targets_name (Optional[str]): Name of the targets data provided by the
                                      data iterator (``iter``).
        mask_name (Optional[str]): Name of the mask data  provided by the
                                   data iterator (``iter``).
    """
network
Network to be evaluated.
Network to be evaluated .
iter
A data iterator which produces the
data on which the scores are computed.
A data iterator which produces the data on which the scores are computed .
scorers
A list or tuple of Scorers.
A list or tuple of Scorers .
out_name
Name of the network output which is scored
against the targets.
Name of the network output which is scored against the targets .
targets_name
Name of the targets data provided by the
data iterator (``iter``).
Name of the targets data provided by the data iterator ( ` ` iter ` ` ) .
mask_name
Name of the mask data  provided by the
data iterator (``iter``).
Name of the mask data provided by the data iterator ( ` ` iter ` ` ) .