Esempio n. 1
0
                print(
                    "  - Replace the default random number generator by "
                    "'from theano.sandbox.rng_mrg import MRG_RandomStreams "
                    "as RandomStreams', as this is is faster. It is still "
                    "experimental, but seems to work correctly.")
                if config.device.startswith("gpu"):
                    print(
                        "     - MRG_RandomStreams is the only random number"
                        " generator supported on the GPU.")
                break

        if not printed_tip:
            print "  Sorry, no tip for today."


register_mode('PROFILE_MODE', ProfileMode())

#needed to print the profile at the end automatically
prof_mode_instance_to_print = [predefined_modes["PROFILE_MODE"]]


def atexit_print_default_profile_mode():
    """Print the summary of the predefined mode ProfileMode if used.

    This all to have the summary printed at exit when
    config.mode=ProfileMode
    """
    for prof_mode in prof_mode_instance_to_print:
        if prof_mode.local_time > 0:
            prof_mode.print_summary()
Esempio n. 2
0
                printed_tip = True

        #tip 5
        for a, t in apply_time.iteritems():
            node = a[1]
            if isinstance(node.op, RandomFunction):
                printed_tip = True
                print "  - Replace the default random number generator by 'from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams', as this is is faster. It is still experimental, but seems to work correctly."
                if config.device.startswith("gpu"):
                    print "     - MRG_RandomStreams is the only random number generator supported on the GPU."
                break

        if not printed_tip:
            print "  Sorry, no tip for today."

register_mode('PROFILE_MODE',ProfileMode())

#needed to print the profile at the end automatically
prof_mode_instance_to_print=[predefined_modes["PROFILE_MODE"]]

def atexit_print_default_profile_mode():
    """Print the summary of the predefined mode PROFILE_MODE if used.

    This all to have the summary printed at exit when
    config.mode=PROFILE_MODE
    """
    for prof_mode in prof_mode_instance_to_print:
        if prof_mode.local_time>0:
            prof_mode.print_summary()

#Register atexit_print_default_profile_mode to have the summary of the
Esempio n. 3
0
        new_optimizer = optimizer
        if optimizer == "":
            new_optimizer = self.provided_optimizer
        new_mode = type(self)(linker=new_linker, optimizer=new_optimizer)
        # If self is in the list or profiles to print, then add the
        # new one as well
        if self in prof_mode_instance_to_print:
            prof_mode_instance_to_print.append(new_mode)

        if message:
            new_mode.message = message

        return new_mode


register_mode("PROFILE_MODE", ProfileMode())


# needed to print the profile at the end automatically
prof_mode_instance_to_print = [predefined_modes["PROFILE_MODE"]]


def atexit_print_default_profile_mode():
    """
    Print the summary of the predefined mode ProfileMode if used.

    This all to have the summary printed at exit when config.mode=ProfileMode.

    """
    for prof_mode in prof_mode_instance_to_print:
        if prof_mode.local_time > 0: