math_ops.py 514 字节
Newer Older
1 2
from paddle.trainer_config_helpers import *

Q
qijun 已提交
3
settings(batch_size=1000, learning_rate=1e-5)
4 5

x = data_layer(name='data', size=100)
6
x = layer_math.exp(x)
X
xuwei06 已提交
7 8
x = layer_math.sqrt(x)
x = layer_math.reciprocal(x)
9 10 11
x = layer_math.log(x)
x = layer_math.abs(x)
x = layer_math.sigmoid(x)
L
Luo Tao 已提交
12
x = layer_math.tanh(x)
13
x = layer_math.square(x)
L
Luo Tao 已提交
14
x = layer_math.relu(x)
15 16 17 18 19 20
y = 1 + x
y = y + 1
y = x + y
y = y - x
y = y - 2
y = 2 - y
X
xuwei06 已提交
21 22
y = 2 * y
y = y * 3
Q
qijun 已提交
23
z = data_layer(name='data_2', size=1)
X
xuwei06 已提交
24 25 26 27
y = y * z
y = z * y
y = y + z
y = z + y
28
outputs(y)