Class AbstractModelGenerator

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, ModelGenerator, Serializable
    Direct Known Subclasses:
    AbstractBrainScriptModelGenerator, MultiGenerator

    public abstract class AbstractModelGenerator
    extends adams.core.option.AbstractOptionHandler
    implements ModelGenerator, adams.core.QuickInfoSupporter
    Ancestor for classes that generate CNTK model scripts.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.flow.core.Actor m_FlowContext
      the flow context.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected String check()
      Hook method for performing checks.
      protected abstract List<String> doGenerate​(int numInput, int numOutput)
      Generates the actual models.
      List<String> generate​(int numInput, int numOutput)
      Generates models.
      adams.flow.core.Actor getFlowContext()
      Returns the flow context, if any.
      String getQuickInfo()
      Returns a quick info about the object, which can be displayed in the GUI.
      void setFlowContext​(adams.flow.core.Actor value)
      Sets the flow context.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_FlowContext

        protected adams.flow.core.Actor m_FlowContext
        the flow context.
    • Constructor Detail

      • AbstractModelGenerator

        public AbstractModelGenerator()
    • Method Detail

      • setFlowContext

        public void setFlowContext​(adams.flow.core.Actor value)
        Sets the flow context.
        Specified by:
        setFlowContext in interface adams.flow.core.FlowContextHandler
        Parameters:
        value - the actor
      • getFlowContext

        public adams.flow.core.Actor getFlowContext()
        Returns the flow context, if any.
        Specified by:
        getFlowContext in interface adams.flow.core.FlowContextHandler
        Returns:
        the actor, null if none available
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Default implementation returns null.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • check

        protected String check()
        Hook method for performing checks.
        Default implementation only ensures that flow context is set.
        Returns:
        null if successful, otherwise error message
      • doGenerate

        protected abstract List<String> doGenerate​(int numInput,
                                                   int numOutput)
        Generates the actual models.
        Parameters:
        numInput - the number of input nodes
        numOutput - the number of output nodes
        Returns:
        the models
      • generate

        public List<String> generate​(int numInput,
                                     int numOutput)
        Generates models.
        Specified by:
        generate in interface ModelGenerator
        Parameters:
        numInput - the number of input nodes
        numOutput - the number of output nodes
        Returns:
        the models