Line | |
---|
1 | package geniusweb.blingbling.Ranknet;
|
---|
2 |
|
---|
3 |
|
---|
4 | import java.util.LinkedList;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | public class RanknetBuilder {
|
---|
8 | private List<Layer> layers;
|
---|
9 | private double learningRate = 1.0f;
|
---|
10 |
|
---|
11 | public RanknetBuilder() {
|
---|
12 | this.layers = new LinkedList<Layer>();
|
---|
13 | }
|
---|
14 |
|
---|
15 | public RanknetBuilder addLayer(Layer layer) {
|
---|
16 | layers.add(layer);
|
---|
17 |
|
---|
18 | return this;
|
---|
19 | }
|
---|
20 |
|
---|
21 | public RanknetBuilder setLearningRate(double rate) {
|
---|
22 | this.learningRate = rate;
|
---|
23 |
|
---|
24 | return this;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public NeuralRankNet build() {
|
---|
28 | NeuralRankNet neuralNet = new NeuralRankNet();
|
---|
29 | neuralNet.setLayers(layers);
|
---|
30 | neuralNet.setLearningRate(learningRate);
|
---|
31 |
|
---|
32 | return neuralNet;
|
---|
33 | }
|
---|
34 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.