Completed
Push — master ( f73e69...91b7c0 )
by Raphael
01:35
created

deepy.layers.Activation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %
Metric Value
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Activation.__init__() 0 3 1
A Activation.compute_tensor() 0 2 1
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 compute_tensor(self, x):
17
        return self._activation(x)