Line | |
---|
1 | package geniusweb.blingbling.Ranknet;
|
---|
2 |
|
---|
3 | import org.nd4j.linalg.api.ndarray.INDArray;
|
---|
4 | import org.nd4j.linalg.factory.Nd4j;
|
---|
5 |
|
---|
6 | public class IdentityActivationFunction implements IActivationFunction {
|
---|
7 | public static final IdentityActivationFunction INSTANCE = new IdentityActivationFunction();
|
---|
8 |
|
---|
9 | private IdentityActivationFunction() { }
|
---|
10 |
|
---|
11 | public INDArray output(INDArray input) {
|
---|
12 | return input;
|
---|
13 | }
|
---|
14 |
|
---|
15 | public INDArray derivative(INDArray input) {
|
---|
16 | return Nd4j.ones(input.shape());
|
---|
17 | }
|
---|
18 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.