当前位置: 首页>>代码示例>>Python>>正文


Python nn.relu方法代码示例

本文整理汇总了Python中tensorflow.nn.relu方法的典型用法代码示例。如果您正苦于以下问题:Python nn.relu方法的具体用法?Python nn.relu怎么用?Python nn.relu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tensorflow.nn的用法示例。


在下文中一共展示了nn.relu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from tensorflow import nn [as 别名]
# 或者: from tensorflow.nn import relu [as 别名]
def __init__(self, hidden_units=(256,), batch_size=64,
                 keep_prob=1.0, activation=nn.relu):
        super(MLPClassifierManyEpochs, self).__init__(
            hidden_units=hidden_units, batch_size=batch_size,
            n_epochs=100, keep_prob=keep_prob,
            activation=activation,
            random_state=42) 
开发者ID:civisanalytics,项目名称:muffnn,代码行数:9,代码来源:test_mlp_classifier.py

示例2: __init__

# 需要导入模块: from tensorflow import nn [as 别名]
# 或者: from tensorflow.nn import relu [as 别名]
def __init__(self, hidden_units=(256,), batch_size=64, n_epochs=5,
                 keep_prob=1.0, activation=nn.relu,
                 random_state=None):
        super(MLPRegressorFewerParams, self).__init__(
            hidden_units=hidden_units, batch_size=batch_size,
            n_epochs=n_epochs, keep_prob=keep_prob,
            activation=activation,
            random_state=random_state) 
开发者ID:civisanalytics,项目名称:muffnn,代码行数:10,代码来源:test_mlp_regressor.py

示例3: fractal_conv2d

# 需要导入模块: from tensorflow import nn [as 别名]
# 或者: from tensorflow.nn import relu [as 别名]
def fractal_conv2d(inputs,
                   num_columns,
                   num_outputs,
                   kernel_size,
                   joined=True,
                   stride=1,
                   padding='SAME',
                   # rate=1,
                   activation_fn=nn.relu,
                   normalizer_fn=slim.batch_norm,
                   normalizer_params=None,
                   weights_initializer=initializers.xavier_initializer(),
                   weights_regularizer=None,
                   biases_initializer=None,
                   biases_regularizer=None,
                   reuse=None,
                   variables_collections=None,
                   outputs_collections=None,
                   is_training=True,
                   trainable=True,
                   scope=None):
  """Builds a fractal block with slim.conv2d.
  The fractal will have `num_columns` columns, and have
  Args:
    inputs: a 4-D tensor  `[batch_size, height, width, channels]`.
    num_columns: integer, the columns in the fractal.
  """
  locs = locals()
  fractal_args = ['inputs','num_columns','joined','is_training']
  asc_fn = lambda : slim.arg_scope([slim.conv2d],
                                   **{arg:val for (arg,val) in locs.items()
                                      if arg not in fractal_args})
  return fractal_template(inputs, num_columns, slim.conv2d, asc_fn,
                          joined, is_training, reuse, scope) 
开发者ID:tensorpro,项目名称:FractalNet,代码行数:36,代码来源:fractal_block.py


注:本文中的tensorflow.nn.relu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。