deepy.layers.Activation.output()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 2
rs 10
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
from . import NeuralLayer
5
from deepy.utils import build_activation
6
7
class Activation(NeuralLayer):
8
    """
9
    Activation layer.
10
    """
11
12
    def __init__(self, activation_type):
13
        super(Activation, self).__init__(activation_type)
14
        self._activation = build_activation(activation_type)
15
16
    def output(self, x):
17
        return self._activation(x)