我是靠谱客的博主 可耐发卡,最近开发中收集的这篇文章主要介绍tensorflow的激活函数,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

https://github.com/tensorflow/tensorflow/blob/r2.0/tensorflow/python/keras/activations.py

linear(x)

@keras_export('keras.activations.linear')
def linear(x):
  """Linear activation function.
  Arguments:
      x: Input tensor.
  Returns:
      The linear activation: `x`.
  """
  return x

sigmoid(x)

  f ( z ) = 1 1 + e − z . f(z) = frac{1}{1 + e^{-z}} .  f(z)=1+ez1.

@keras_export('keras.activations.sigmoid')
def sigmoid(x):
  """Sigmoid.
  Applies the sigmoid activation function. The sigmoid function is defined as
  1 divided by (1 + exp(-x)). It's curve is like an "S" and is like a smoothed
  version of the Heaviside (Unit Step Function) function. For small values
  (<-5) the sigmoid returns a value close to zero and for larger values (>5)
  the result of the function gets close to 1.
  Arguments:
      x: A tensor or variable.
  Returns:
      A tensor.
  Sigmoid activation function.
  Arguments:
      x: Input tensor.
  Returns:
      The sigmoid activation: `(1.0 / (1.0 + exp(-x)))`.
  """
  return nn.sigmoid(x)

最后

以上就是可耐发卡为你收集整理的tensorflow的激活函数的全部内容,希望文章能够帮你解决tensorflow的激活函数所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部