Packages

class TensorTree[T] extends Serializable

TensorTree class is used to decode a tensor to a tree structure. The given input content is a tensor which encodes a constituency parse tree. The tensor should have the following structure:

Each row of the tensor represents a tree node and the row number is node number For each row, except the last column, all other columns represent the children node number of this node. Assume the value of a certain column of the row is not zero, the value p means this node has a child whose node number is p (lies in the p-th) row. Each leaf has a leaf number, in the tensor, the last column represents the leaf number. Each leaf does not have any children, so all the columns of a leaf except the last should be zero. If a node is the root, the last column should equal to -1.

Note: if any row for padding, the padding rows should be placed at the last rows with all elements equal to -1.

eg. a tensor represents a binary tree:

[11, 10, -1; 0, 0, 1; 0, 0, 2; 0, 0, 3; 0, 0, 4; 0, 0, 5; 0, 0, 6; 4, 5, 0; 6, 7, 0; 8, 9, 0; 2, 3, 0; -1, -1, -1; -1, -1, -1]

T

Numeric type Float or Double

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TensorTree
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TensorTree(content: Tensor[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    content

    the tensor to be encoded

    ev

    implicit tensor numeric

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. def addChild(parent: Int, child: T): Unit
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def children(index: Int): Array[Int]
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. val content: Tensor[T]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def exists(index: Int): Boolean
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def getRoot: Int
  15. def hasChild(index: Int): Boolean
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def isPadding(index: Int): Boolean
  19. def leafIndex(index: Int): Int
  20. def markAsLeaf(index: Int, leafIndex: Int): Unit
  21. def markAsRoot(index: Int): Unit
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def noChild(index: Int): Boolean
  24. def nodeNumber: Int
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. def size: Array[Int]
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped