示例#1
0
    def browse(self, command=None, catch_errors = False, close_after = False, filterexp=None, filterrec = None,
            view_mode ='full', raise_display_errors=False, run_args=None, keep_record=True, truncate_result_to=100,
            cache_result_string = False, remove_prefix = None, display_format='nested', **kwargs):
        """
        Open up the UI, which allows you to run experiments and view their results.

        :param command: Optionally, a string command to pass directly to the UI.  (e.g. "run 1")
        :param catch_errors: Catch errors that arise while running experiments
        :param close_after: Close after issuing one command.
        :param filterexp: Filter the experiments with this selection (see help for how to use)
        :param filterrec: Filter the experiment records with this selection (see help for how to use)
        :param view_mode: How to view experiments {'full', 'results'} ('results' leads to a narrower display).
        :param raise_display_errors: Raise errors that arise when displaying the table (otherwise just indicate that display failed in table)
        :param run_args: A dict of named arguments to pass on to Experiment.run
        :param keep_record: Keep a record of the experiment after running.
        :param truncate_result_to: An integer, indicating the maximum length of the result string to display.
        :param cache_result_string: Cache the result string (useful when it takes a very long time to display the results
            when opening up the menu - often when results are long lists).
        :param remove_prefix: Remove the common prefix on the experiment ids in the display.
        :param display_format: How experements and their records are displayed: 'nested' or 'flat'.  'nested' might be
            better for narrow console outputs.
        """
        from artemis.experiments.ui import browse_experiments
        browse_experiments(command = command, root_experiment=self, catch_errors=catch_errors, close_after=close_after,
            filterexp=filterexp, filterrec=filterrec,
            view_mode=view_mode, raise_display_errors=raise_display_errors, run_args=run_args, keep_record=keep_record,
            truncate_result_to=truncate_result_to, cache_result_string=cache_result_string, remove_prefix=remove_prefix,
            display_format=display_format, **kwargs)
示例#2
0
    def browse(self, command=None, catch_errors = False, close_after = False, filterexp=None, filterrec = None,
            view_mode ='full', raise_display_errors=False, run_args=None, keep_record=True, truncate_result_to=100,
            cache_result_string = False, remove_prefix = None, display_format='nested', **kwargs):
        """
        Open up the UI, which allows you to run experiments and view their results.

        :param command: Optionally, a string command to pass directly to the UI.  (e.g. "run 1")
        :param catch_errors: Catch errors that arise while running experiments
        :param close_after: Close after issuing one command.
        :param filterexp: Filter the experiments with this selection (see help for how to use)
        :param filterrec: Filter the experiment records with this selection (see help for how to use)
        :param view_mode: How to view experiments {'full', 'results'} ('results' leads to a narrower display).
        :param raise_display_errors: Raise errors that arise when displaying the table (otherwise just indicate that display failed in table)
        :param run_args: A dict of named arguments to pass on to Experiment.run
        :param keep_record: Keep a record of the experiment after running.
        :param truncate_result_to: An integer, indicating the maximum length of the result string to display.
        :param cache_result_string: Cache the result string (useful when it takes a very long time to display the results
            when opening up the menu - often when results are long lists).
        :param remove_prefix: Remove the common prefix on the experiment ids in the display.
        :param display_format: How experements and their records are displayed: 'nested' or 'flat'.  'nested' might be
            better for narrow console outputs.
        """
        from artemis.experiments.ui import browse_experiments
        browse_experiments(command = command, root_experiment=self, catch_errors=catch_errors, close_after=close_after,
            filterexp=filterexp, filterrec=filterrec,
            view_mode=view_mode, raise_display_errors=raise_display_errors, run_args=run_args, keep_record=keep_record,
            truncate_result_to=truncate_result_to, cache_result_string=cache_result_string, remove_prefix=remove_prefix,
            display_format=display_format, **kwargs)
示例#3
0
            print 'Epoch {epoch}: Test Cost: {test}, Training Cost: {train}'.format(
                epoch=float(i) / n_training_samples,
                test=test_cost,
                train=training_cost)
            epoch = float(i) / n_training_samples
            epoch_scores.append((epoch, training_cost, test_cost))
        predictor.train(training_data[[i % n_training_samples]],
                        training_target[[i % n_training_samples]])

    # Plot
    epochs, training_costs, test_costs = zip(*epoch_scores)
    plt.plot(epochs, np.array([training_costs, test_costs]).T)
    plt.xlabel('epoch')
    plt.ylabel('cost')
    plt.legend(['Training Cost', 'Test Cost'])
    plt.title("Learning Curve")
    plt.ion()
    plt.show()

    return {'training_cost': training_cost, 'test_cost': test_cost}


demo_linear_regression.add_variant('fast-learn', eta=0.01)

demo_linear_regression.add_variant('large_input_space', n_in=1000)

if __name__ == "__main__":

    # Open a menu that allows you to run experiments and view old ones.
    browse_experiments()
示例#4
0
 def browse(self, **kwargs):
     from artemis.experiments.ui import browse_experiments
     browse_experiments(root_experiment=self, **kwargs)