public class NetworkUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
setLearningRate(ComputationGraph net,
double newLr)
Set the learning rate for all layers in the network to the specified value.
|
static void |
setLearningRate(ComputationGraph net,
org.nd4j.linalg.schedule.ISchedule newLrSchedule)
Set the learning rate schedule for all layers in the network to the specified schedule.
|
static void |
setLearningRate(ComputationGraph net,
String layerName,
double newLr)
Set the learning rate for a single layer in the network to the specified value.
|
static void |
setLearningRate(ComputationGraph net,
String layerName,
org.nd4j.linalg.schedule.ISchedule lrSchedule)
Set the learning rate schedule for a single layer in the network to the specified value.
Note also that setLearningRate(ComputationGraph, ISchedule) should also be used in preference, when all
layers need to be set to a new LR schedule.This schedule will replace any/all existing schedules, and also any fixed learning rate values. Note also that the iteration/epoch counts will not be reset. |
static void |
setLearningRate(MultiLayerNetwork net,
double newLr)
Set the learning rate for all layers in the network to the specified value.
|
static void |
setLearningRate(MultiLayerNetwork net,
int layerNumber,
double newLr)
Set the learning rate for a single layer in the network to the specified value.
|
static void |
setLearningRate(MultiLayerNetwork net,
int layerNumber,
org.nd4j.linalg.schedule.ISchedule lrSchedule)
Set the learning rate schedule for a single layer in the network to the specified value.
Note also that setLearningRate(MultiLayerNetwork, ISchedule) should also be used in preference, when all layers need
to be set to a new LR schedule.This schedule will replace any/all existing schedules, and also any fixed learning rate values. Note also that the iteration/epoch counts will not be reset. |
static void |
setLearningRate(MultiLayerNetwork net,
org.nd4j.linalg.schedule.ISchedule newLrSchedule)
Set the learning rate schedule for all layers in the network to the specified schedule.
|
static ComputationGraph |
toComputationGraph(MultiLayerNetwork net)
Convert a MultiLayerNetwork to a ComputationGraph
|
public static ComputationGraph toComputationGraph(MultiLayerNetwork net)
public static void setLearningRate(MultiLayerNetwork net, double newLr)
net
- Network to set the LR fornewLr
- New learning rate for all layerspublic static void setLearningRate(MultiLayerNetwork net, org.nd4j.linalg.schedule.ISchedule newLrSchedule)
MultiLayerConfiguration#setIterationCount(int)
and MultiLayerConfiguration#setEpochCount(int)
if this is requirednewLrSchedule
- New learning rate schedule for all layerspublic static void setLearningRate(MultiLayerNetwork net, int layerNumber, double newLr)
setLearningRate(MultiLayerNetwork, double)
should also be used in preference, when all layers need to be set to a new LRlayerNumber
- Number of the layer to set the LR fornewLr
- New learning rate for a single layerspublic static void setLearningRate(MultiLayerNetwork net, int layerNumber, org.nd4j.linalg.schedule.ISchedule lrSchedule)
setLearningRate(MultiLayerNetwork, ISchedule)
should also be used in preference, when all layers need
to be set to a new LR schedule.MultiLayerConfiguration#setIterationCount(int)
and MultiLayerConfiguration#setEpochCount(int)
if this is requiredlayerNumber
- Number of the layer to set the LR schedule forlrSchedule
- New learning rate for a single layerpublic static void setLearningRate(ComputationGraph net, double newLr)
net
- Network to set the LR fornewLr
- New learning rate for all layerspublic static void setLearningRate(ComputationGraph net, org.nd4j.linalg.schedule.ISchedule newLrSchedule)
ComputationGraphConfiguration#setIterationCount(int)
and ComputationGraphConfiguration#setEpochCount(int)
if this is requirednewLrSchedule
- New learning rate schedule for all layerspublic static void setLearningRate(ComputationGraph net, String layerName, double newLr)
setLearningRate(ComputationGraph, double)
should also be used in preference, when all layers need to be set to a new LRlayerName
- Name of the layer to set the LR fornewLr
- New learning rate for a single layerspublic static void setLearningRate(ComputationGraph net, String layerName, org.nd4j.linalg.schedule.ISchedule lrSchedule)
setLearningRate(ComputationGraph, ISchedule)
should also be used in preference, when all
layers need to be set to a new LR schedule.ComputationGraphConfiguration#setIterationCount(int)
and ComputationGraphConfiguration#setEpochCount(int)
if this is requiredlayerName
- Name of the layer to set the LR schedule forlrSchedule
- New learning rate for a single layerCopyright © 2018. All rights reserved.