Class RandomWalker.Builder<T extends SequenceElement>
- java.lang.Object
-
- org.deeplearning4j.models.sequencevectors.graph.walkers.impl.RandomWalker.Builder<T>
-
- Direct Known Subclasses:
PopularityWalker.Builder
,WeightedWalker.Builder
- Enclosing class:
- RandomWalker<T extends SequenceElement>
public static class RandomWalker.Builder<T extends SequenceElement> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected double
alpha
protected NoEdgeHandling
noEdgeHandling
protected long
seed
protected IGraph<T,?>
sourceGraph
protected WalkDirection
walkDirection
protected int
walkLength
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomWalker<T>
build()
This method builds RandomWalker instanceRandomWalker.Builder<T>
setNoEdgeHandling(@NonNull NoEdgeHandling handling)
This method defines walker behavior when it gets to node which has no next nodes available Default value: RESTART_ON_DISCONNECTEDRandomWalker.Builder<T>
setRestartProbability(double alpha)
This method defines a chance for walk restart Good value would be somewhere between 0.03-0.07RandomWalker.Builder<T>
setSeed(long seed)
This method specifies random seed.RandomWalker.Builder<T>
setWalkDirection(@NonNull WalkDirection direction)
This method defines next hop selection within walkRandomWalker.Builder<T>
setWalkLength(int walkLength)
This method specifies output sequence (walk) length
-
-
-
Field Detail
-
walkLength
protected int walkLength
-
noEdgeHandling
protected NoEdgeHandling noEdgeHandling
-
sourceGraph
protected IGraph<T extends SequenceElement,?> sourceGraph
-
seed
protected long seed
-
walkDirection
protected WalkDirection walkDirection
-
alpha
protected double alpha
-
-
Method Detail
-
setWalkLength
public RandomWalker.Builder<T> setWalkLength(int walkLength)
This method specifies output sequence (walk) length- Parameters:
walkLength
-- Returns:
-
setNoEdgeHandling
public RandomWalker.Builder<T> setNoEdgeHandling(@NonNull @NonNull NoEdgeHandling handling)
This method defines walker behavior when it gets to node which has no next nodes available Default value: RESTART_ON_DISCONNECTED- Parameters:
handling
-- Returns:
-
setSeed
public RandomWalker.Builder<T> setSeed(long seed)
This method specifies random seed.- Parameters:
seed
-- Returns:
-
setWalkDirection
public RandomWalker.Builder<T> setWalkDirection(@NonNull @NonNull WalkDirection direction)
This method defines next hop selection within walk- Parameters:
direction
-- Returns:
-
setRestartProbability
public RandomWalker.Builder<T> setRestartProbability(double alpha)
This method defines a chance for walk restart Good value would be somewhere between 0.03-0.07- Parameters:
alpha
-- Returns:
-
build
public RandomWalker<T> build()
This method builds RandomWalker instance- Returns:
-
-