zoukankan      html  css  js  c++  java
  • theano profile

      所以我建议的关闭防火墙命令是

      iptables -P INPUT ACCEPT

      iptables -P FORWARD ACCEPT

      iptables -P OUTPUT ACCEPT

      iptables -F


    .. _tut_profiling:

    =========================
    Profiling Theano function
    =========================

    .. note::

        This method replace the old ProfileMode. Do not use ProfileMode
        anymore.

    Old:

    #vim ~/.theanorc

    find [global] add:

    Mode = ProfileMode


    Besides checking for errors, another important task is to profile your
    code in terms of speed and/or memory usage.

    You can profile your
    functions using either of the following two options:


    1. Use Theano flag :attr:`config.profile` to enable profiling.
        - To enable the memory profiler use the Theano flag:
          :attr:`config.profile_memory` in addition to :attr:`config.profile`.
        - Moreover, to enable the profiling of Theano optimization phase,
          use the Theano flag: :attr:`config.profile_optimizer` in addition
          to :attr:`config.profile`.
        - You can also use the Theano flags :attr:`profiling.n_apply`,
          :attr:`profiling.n_ops` and :attr:`profiling.min_memory_size`
          to modify the quantity of information printed.

    #vim ~/.theanorc

    find [global]

    add

    Profile = True


    2. Pass the argument :attr:`profile=True` to the function :func:`theano.function <function.function>`. And then call :attr:`f.profile.print_summary()` for a single function.
        - Use this option when you want to profile not all the
          functions but one or more specific function(s).
        - You can also combine the profile of many functions:
        
          .. doctest::
              :hide:

              profile = theano.compile.ProfileStats()
              f = theano.function(..., profile=profile)  # doctest: +SKIP
              g = theano.function(..., profile=profile)  # doctest: +SKIP
              ...  # doctest: +SKIP
              profile.print_summary()

    if profile is not work:

    add lines above is useful......

    The profiler will output one profile per Theano function and profile
    that is the sum of the printed profiles. Each profile contains 4
    sections: global info, class info, Ops info and Apply node info.

    In the global section, the "Message" is the name of the Theano
    function. theano.function() has an optional parameter ``name`` that
    defaults to None. Change it to something else to help you profile many
    Theano functions. In that section, we also see the number of times the
    function was called (1) and the total time spent in all those
    calls. The time spent in Function.fn.__call__ and in thunks is useful
    to understand Theano overhead.


    to run the example:

      THEANO_FLAGS=optimizer_excluding=fusion:inplace,profile=True python doc/tutorial/profiling_example.py

    The output:

    .. literalinclude:: profiling_example_out.prof

  • 相关阅读:
    unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
    Go的学习笔记之Channel发送和接收
    聊聊 PC 端自动化最佳方案
    一文彻底搞懂快速幂(原理实现、矩阵快速幂)
    一次core.<number> 文件占满磁盘空间的处理过程
    博文目录
    备忘录:C#获取微信小程序的云数据库中数据
    T-SQL——关于跨库连接查询
    .NET异步程序设计——给线程传递数据
    自研 Pulsar Starter:winfun-pulsar-spring-boot-starter
  • 原文地址:https://www.cnblogs.com/Viewsky/p/5782634.html
Copyright © 2011-2022 走看看