Take a specific time step from 3D tensor.
| 132 | |
| 133 | |
| 134 | class TimeStepSlicer(Layer): |
| 135 | """Take a specific time step from 3D tensor.""" |
| 136 | |
| 137 | def __init__(self, step=-1): |
| 138 | self.step = step |
| 139 | |
| 140 | def forward_pass(self, x): |
| 141 | return x[:, self.step, :] |
| 142 | |
| 143 | def backward_pass(self, delta): |
| 144 | return np.repeat(delta[:, np.newaxis, :], 2, 1) |
| 145 | |
| 146 | def shape(self, x_shape): |
| 147 | return x_shape[0], x_shape[2] |
| 148 | |
| 149 | |
| 150 | class TimeDistributedDense(Layer): |
nothing calls this directly
no outgoing calls
no test coverage detected