Packages

o

com.johnsnowlabs.nlp.annotators.graph

DenseClassifierGraphResolver

object DenseClassifierGraphResolver

Finds the best embedded (or user provided) graph for a dense classifier training run.

The feature vectors and the one hot encoded labels are zero padded to the dimensions of the graph by TensorflowGenericClassifier, so a graph is usable whenever its dimensions are greater than or equal to the dimensions of the training data. Padded inputs contribute nothing to the dense layers and padded labels are never the target class, therefore the training result of a padded graph is equivalent to the training result of an exactly sized graph. Still, the smallest suitable graph is selected, and a graph with the exact number of classes is always preferred, so that the reported metrics are computed over the real classes only.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DenseClassifierGraphResolver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def listGraphs(family: DenseClassifierGraphFamily, localGraphPath: Option[String] = None): Seq[DenseClassifierGraphInfo]

    Lists the graphs of the given family, either from the JAR resources or from a user provided folder.

  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def parseDimensions(fileName: String, requiredPrefix: Option[String] = None): Option[(Int, Int)]

    Extracts (inputDim, outputDim) from a graph file name.

    Extracts (inputDim, outputDim) from a graph file name.

    fileName

    name of the graph file

    requiredPrefix

    when defined, only file names starting with this prefix are accepted

  17. def searchForSuitableGraph(family: DenseClassifierGraphFamily, inputDim: Int, outputDim: Int, localGraphPath: Option[String] = None): DenseClassifierGraphInfo

    Returns the smallest graph of this family able to train inputDim features into outputDim classes.

    Returns the smallest graph of this family able to train inputDim features into outputDim classes.

    family

    graph family of the annotator being trained

    inputDim

    length of the feature vectors

    outputDim

    number of classes

    localGraphPath

    optional user folder with graphs, takes precedence over the embedded ones

  18. def selectGraph(candidates: Seq[DenseClassifierGraphInfo], inputDim: Int, outputDim: Int): Option[DenseClassifierGraphInfo]

    Picks the graph to train with out of the given candidates: the smallest one able to hold the data, preferring an exact number of classes.

  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped