Class CheckpointListener

    • Method Detail

      • iterationDone

        public void iterationDone​(Model model,
                                  int iteration,
                                  int epoch)
        Description copied from interface: TrainingListener
        Event listener for each iteration. Called once, after each parameter update has ocurred while training the network
        Specified by:
        iterationDone in interface TrainingListener
        Overrides:
        iterationDone in class BaseTrainingListener
        Parameters:
        model - the model iterating
        iteration - the iteration
      • getIter

        protected static int getIter​(Model model)
      • getEpoch

        protected static int getEpoch​(Model model)
      • getModelType

        protected static String getModelType​(Model model)
      • availableCheckpoints

        public List<Checkpoint> availableCheckpoints()
        List all available checkpoints. A checkpoint is 'available' if the file can be loaded. Any checkpoint files that have been automatically deleted (given the configuration) will not be returned here.
        Returns:
        List of checkpoint files that can be loaded
      • availableCheckpoints

        public static List<Checkpoint> availableCheckpoints​(File directory)
        List all available checkpoints. A checkpoint is 'available' if the file can be loaded. Any checkpoint files that have been automatically deleted (given the configuration) will not be returned here. Note that the checkpointInfo.txt file must exist, as this stores checkpoint information
        Returns:
        List of checkpoint files that can be loaded from the specified directory
      • lastCheckpoint

        public Checkpoint lastCheckpoint()
        Return the most recent checkpoint, if one exists - otherwise returns null
        Returns:
        Checkpoint
      • lastCheckpoint

        public static Checkpoint lastCheckpoint​(File rootDir)
        Return the most recent checkpoint, if one exists - otherwise returns null
        Parameters:
        rootDir - Root direcotry for the checkpoint files
        Returns:
        Checkpoint
      • getFileForCheckpoint

        public File getFileForCheckpoint​(Checkpoint checkpoint)
        Get the model file for the given checkpoint. Checkpoint model file must exist
        Parameters:
        checkpoint - Checkpoint to get the model file for
        Returns:
        Model file for the checkpoint
      • getFileForCheckpoint

        public File getFileForCheckpoint​(int checkpointNum)
        Get the model file for the given checkpoint number. Checkpoint model file must exist
        Parameters:
        checkpointNum - Checkpoint number to get the model file for
        Returns:
        Model file for the checkpoint
      • getFileForCheckpoint

        public static File getFileForCheckpoint​(File rootDir,
                                                int checkpointNum)
      • loadCheckpointMLN

        public MultiLayerNetwork loadCheckpointMLN​(Checkpoint checkpoint)
        Load a MultiLayerNetwork for the given checkpoint
        Parameters:
        checkpoint - Checkpoint model to load
        Returns:
        The loaded model
      • loadCheckpointMLN

        public MultiLayerNetwork loadCheckpointMLN​(int checkpointNum)
        Load a MultiLayerNetwork for the given checkpoint number
        Parameters:
        checkpointNum - Checkpoint model to load
        Returns:
        The loaded model
      • loadCheckpointMLN

        public static MultiLayerNetwork loadCheckpointMLN​(File rootDir,
                                                          Checkpoint checkpoint)
        Load a MultiLayerNetwork for the given checkpoint that resides in the specified root directory
        Parameters:
        rootDir - Root directory for the checkpoint
        checkpoint - Checkpoint model to load
        Returns:
        The loaded model
      • loadCheckpointMLN

        public static MultiLayerNetwork loadCheckpointMLN​(File rootDir,
                                                          int checkpointNum)
        Load a MultiLayerNetwork for the given checkpoint number
        Parameters:
        rootDir - The directory that the checkpoint resides in
        checkpointNum - Checkpoint model to load
        Returns:
        The loaded model
      • loadLastCheckpointMLN

        public static MultiLayerNetwork loadLastCheckpointMLN​(File rootDir)
        Load the last (most recent) checkpoint from the specified root directory
        Parameters:
        rootDir - Root directory to load checpoint from
        Returns:
        MultiLayerNetwork for last checkpoint
      • loadCheckpointCG

        public ComputationGraph loadCheckpointCG​(Checkpoint checkpoint)
        Load a ComputationGraph for the given checkpoint
        Parameters:
        checkpoint - Checkpoint model to load
        Returns:
        The loaded model
      • loadCheckpointCG

        public static ComputationGraph loadCheckpointCG​(File rootDir,
                                                        Checkpoint checkpoint)
        Load a ComputationGraph for the given checkpoint from the specified root direcotry
        Parameters:
        checkpoint - Checkpoint model to load
        Returns:
        The loaded model
      • loadCheckpointCG

        public ComputationGraph loadCheckpointCG​(int checkpointNum)
        Load a ComputationGraph for the given checkpoint
        Parameters:
        checkpointNum - Checkpoint model number to load
        Returns:
        The loaded model
      • loadCheckpointCG

        public static ComputationGraph loadCheckpointCG​(File rootDir,
                                                        int checkpointNum)
        Load a ComputationGraph for the given checkpoint that resides in the specified root directory
        Parameters:
        rootDir - Directory that the checkpoint resides in
        checkpointNum - Checkpoint model number to load
        Returns:
        The loaded model
      • loadLastCheckpointCG

        public static ComputationGraph loadLastCheckpointCG​(File rootDir)
        Load the last (most recent) checkpoint from the specified root directory
        Parameters:
        rootDir - Root directory to load checpoint from
        Returns:
        ComputationGraph for last checkpoint