public class VoidParameterServer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Clipboard |
clipboard |
protected ThreadPoolExecutor |
executor |
protected Map<String,Frame<TrainingMessage>> |
frames |
protected AtomicBoolean |
initFinished |
protected AtomicBoolean |
initLocker |
protected AtomicBoolean |
manualMode |
protected static double |
MAX_EXP |
protected NodeRole |
nodeRole |
protected static int |
numThreads |
protected Runnable[] |
processingRunnables |
protected Thread[] |
processingThreads |
protected AtomicBoolean |
runner |
protected short |
shardIndex |
protected AtomicBoolean |
shutdownFinished |
protected AtomicBoolean |
shutdownLocker |
protected Storage |
storage |
protected TrainingDriver<? extends TrainingMessage> |
trainer |
protected Transport |
transport |
protected VoidConfiguration |
voidConfiguration |
| Modifier | Constructor and Description |
|---|---|
protected |
VoidParameterServer() |
protected |
VoidParameterServer(boolean manualMode) |
protected |
VoidParameterServer(NodeRole nodeRole) |
| Modifier and Type | Method and Description |
|---|---|
void |
execDistributed(Frame<? extends TrainingMessage> messages) |
void |
execDistributed(TrainingMessage message)
This method dispatches TrainingMessage to ParameterServer network
PLEASE NOTE: This method is synchronized and *periodically* becomes blocking by design
|
void |
execDistributedImmediately(TrainingMessage message) |
protected org.nd4j.linalg.api.ndarray.INDArray |
getExpTable() |
static VoidParameterServer |
getInstance() |
static Set<String> |
getLocalAddresses()
This method returns set of local IP addresses available in system.
|
protected org.nd4j.linalg.api.ndarray.INDArray |
getNegTable() |
protected org.nd4j.linalg.primitives.Pair<NodeRole,String> |
getRole(VoidConfiguration voidConfiguration,
Collection<String> localIPs)
This method checks for designated role, according to local IP addresses and configuration passed into method
|
short |
getShardIndex()
This method returns shardIndex value.
|
protected org.nd4j.linalg.api.ndarray.INDArray |
getSyn0() |
protected org.nd4j.linalg.api.ndarray.INDArray |
getSyn1() |
protected org.nd4j.linalg.api.ndarray.INDArray |
getSyn1Neg() |
protected Transport |
getTransport() |
org.nd4j.linalg.api.ndarray.INDArray |
getVector(int rowIdx) |
org.nd4j.linalg.api.ndarray.INDArray |
getVector(Integer key,
int rowIdx)
This method returns INDArray matching requested storageId value
PLEASE NOTE: This method IS blocking
|
protected void |
handleMessage(VoidMessage message) |
protected void |
init(VoidConfiguration voidConfiguration) |
void |
init(VoidConfiguration voidConfiguration,
Transport transport,
TrainingDriver<? extends TrainingMessage> trainer)
This method starts ParameterServer instance
PLEASE NOTE: This method is blocking for first caller only
|
void |
initializeSeqVec(int vectorLength,
int numWords,
long seed,
int columnsPerShard,
boolean useHs,
boolean useNegSampling)
This method handles Shards initialization
PLEASE NOTE: This method is blocking
|
boolean |
isInit()
This method returns True if initialization was started AND was finished, false otherwise
|
void |
sendMessageToAllClients(VoidMessage message)
This method sends given message to all Clients
|
void |
sendMessageToAllClients(VoidMessage message,
Long... exclusions)
This method sends given message to all Clients, excluding
|
void |
sendMessageToAllShards(VoidMessage message)
This method sends given message to all Shards
|
protected void |
setIpPortForShard(String ip,
int port) |
protected void |
setShardIndex(short idx) |
void |
setTrainingDriver(TrainingDriver<? extends TrainingMessage> trainer) |
void |
shutdown()
This method initiates shutdown sequence for this instance.
|
protected VoidParameterServer |
toggleManualMode(boolean mode)
This method is available for debug purposes only
|
protected volatile NodeRole nodeRole
protected volatile VoidConfiguration voidConfiguration
protected AtomicBoolean initLocker
protected AtomicBoolean initFinished
protected AtomicBoolean shutdownLocker
protected AtomicBoolean shutdownFinished
protected transient Transport transport
protected transient AtomicBoolean manualMode
protected transient AtomicBoolean runner
protected transient Thread[] processingThreads
protected transient Runnable[] processingRunnables
protected transient TrainingDriver<? extends TrainingMessage> trainer
protected short shardIndex
protected Clipboard clipboard
protected Storage storage
protected Map<String,Frame<TrainingMessage>> frames
protected static final int numThreads
protected ThreadPoolExecutor executor
protected static double MAX_EXP
protected VoidParameterServer()
protected VoidParameterServer(@NonNull
NodeRole nodeRole)
protected VoidParameterServer(boolean manualMode)
public static VoidParameterServer getInstance()
public void setTrainingDriver(@NonNull
TrainingDriver<? extends TrainingMessage> trainer)
public short getShardIndex()
protected void setIpPortForShard(String ip, int port)
protected void setShardIndex(short idx)
protected Transport getTransport()
protected org.nd4j.linalg.api.ndarray.INDArray getSyn0()
protected org.nd4j.linalg.api.ndarray.INDArray getSyn1()
protected org.nd4j.linalg.api.ndarray.INDArray getSyn1Neg()
protected org.nd4j.linalg.api.ndarray.INDArray getExpTable()
protected org.nd4j.linalg.api.ndarray.INDArray getNegTable()
protected void init(@NonNull
VoidConfiguration voidConfiguration)
public boolean isInit()
public void init(@NonNull
VoidConfiguration voidConfiguration,
@NonNull
Transport transport,
TrainingDriver<? extends TrainingMessage> trainer)
protected VoidParameterServer toggleManualMode(boolean mode)
mode - protected org.nd4j.linalg.primitives.Pair<NodeRole,String> getRole(@NonNull VoidConfiguration voidConfiguration, @NonNull Collection<String> localIPs)
voidConfiguration - localIPs - public void shutdown()
public static Set<String> getLocalAddresses()
protected void handleMessage(@NonNull
VoidMessage message)
public void initializeSeqVec(int vectorLength,
int numWords,
long seed,
int columnsPerShard,
boolean useHs,
boolean useNegSampling)
public void execDistributed(@NonNull
TrainingMessage message)
message - public void execDistributedImmediately(@NonNull
TrainingMessage message)
public void execDistributed(@NonNull
Frame<? extends TrainingMessage> messages)
public org.nd4j.linalg.api.ndarray.INDArray getVector(int rowIdx)
public org.nd4j.linalg.api.ndarray.INDArray getVector(@NonNull
Integer key,
int rowIdx)
rowIdx - public void sendMessageToAllShards(@NonNull
VoidMessage message)
message - public void sendMessageToAllClients(@NonNull
VoidMessage message)
message - public void sendMessageToAllClients(@NonNull
VoidMessage message,
Long... exclusions)
message - Copyright © 2017. All rights reserved.