Orthogonal
Stay organized with collections
Save and categorize content based on your preferences.
Initializer that generates an orthogonal matrix.
If the shape of the tensor to initialize is two-dimensional, it is initialized with an
orthogonal matrix obtained from the QR decomposition of a matrix of random numbers drawn from a
normal distribution. If the matrix has fewer rows than columns then the output will have
orthogonal rows. Otherwise, the output will have orthogonal columns.
If the shape of the tensor to initialize is more than two-dimensional, a matrix of shape
(shape.size(0) * ... * shape.size(n - 2), shape.size(n - 1))
is initialized, where
n
is the length of the shape vector. The matrix is subsequently reshaped to give a
tensor of the desired shape.
Examples:
Orthogonal<TFloat32, TFloat32> initializer =
new org.tensorflow.framework.initializers.Orthogonal<>(tf);
Operand<TFloat32> values =
initializer.call(tf.constant(Shape.of(2,2)), TFloat32.class);
Public Constructors
|
|
|
Orthogonal(Ops tf, double gain, long seed)
Creates an Orthogonal Initializer
|
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Constants
public
static
final
double
GAIN_DEFAULT
Public Constructors
public
Orthogonal
(Ops tf, long seed)
Creates an Orthogonal Initializer using GAIN_DEFAULT
for the gain.
Parameters
tf |
the TensorFlow Ops |
seed |
the seed for random number generation. An initializer created with a given seed
will always produce the same random tensor for a given shape and dtype.
|
public
Orthogonal
(Ops tf, double gain, long seed)
Creates an Orthogonal Initializer
Parameters
tf |
the TensorFlow Ops |
gain |
the gain to be applied to the Matrix. |
seed |
the seed for random number generation. An initializer created with a given seed
will always produce the same random tensor for a given shape and dtype.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 UTC."],[],[],null,["# Orthogonal\n\npublic class **Orthogonal** \nInitializer that generates an orthogonal matrix.\n\nIf the shape of the tensor to initialize is two-dimensional, it is initialized with an\northogonal matrix obtained from the QR decomposition of a matrix of random numbers drawn from a\nnormal distribution. If the matrix has fewer rows than columns then the output will have\northogonal rows. Otherwise, the output will have orthogonal columns.\n\nIf the shape of the tensor to initialize is more than two-dimensional, a matrix of shape\n`(shape.size(0) * ... * shape.size(n - 2), shape.size(n - 1))` is initialized, where\n`n` is the length of the shape vector. The matrix is subsequently reshaped to give a\ntensor of the desired shape.\n\nExamples:\n\n```\n Orthogonal\u003cTFloat32, TFloat32\u003e initializer =\n new org.tensorflow.framework.initializers.Orthogonal\u003c\u003e(tf);\n Operand\u003cTFloat32\u003e values =\n initializer.call(tf.constant(Shape.of(2,2)), TFloat32.class);\n \n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Constants\n\n|--------|--------------------------------------------------------------------------------------------------|---|\n| double | [GAIN_DEFAULT](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#GAIN_DEFAULT) | |\n\n### Public Constructors\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Orthogonal](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#Orthogonal(Ops, long))(Ops tf, long seed) Creates an Orthogonal Initializer using [GAIN_DEFAULT](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#GAIN_DEFAULT) for the gain. |\n| | [Orthogonal](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#Orthogonal(Ops, double, long))(Ops tf, double gain, long seed) Creates an Orthogonal Initializer |\n\n### Public Methods\n\n|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e | [call](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#call(org.tensorflow.Operand\u003corg.tensorflow.types.TInt64\u003e, java.lang.Class\u003cT\u003e))([Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TInt64](/jvm/api_docs/java/org/tensorflow/types/TInt64)\\\u003e dims, Class\\\u003cT\\\u003e type) |\n\n### Inherited Methods\n\nFrom class [org.tensorflow.framework.initializers.BaseInitializer](/jvm/api_docs/java/org/tensorflow/framework/initializers/BaseInitializer) \n\n|-----|---------------------------------------------------------------------------------------------------------------------|\n| Ops | [getTF](/jvm/api_docs/java/org/tensorflow/framework/initializers/BaseInitializer#getTF())() Gets the TensorFlow Ops |\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface [org.tensorflow.framework.initializers.Initializer](/jvm/api_docs/java/org/tensorflow/framework/initializers/Initializer) \n\n|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e | [call](/jvm/api_docs/java/org/tensorflow/framework/initializers/Initializer#call(org.tensorflow.Operand\u003corg.tensorflow.types.TInt64\u003e, java.lang.Class\u003cT\u003e))([Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TInt64](/jvm/api_docs/java/org/tensorflow/types/TInt64)\\\u003e dims, Class\\\u003cT\\\u003e type) Generates the operation used to perform the initialization. |\n\nConstants\n---------\n\n#### public static final double\n**GAIN_DEFAULT**\n\n\u003cbr /\u003e\n\nConstant Value: 1.0\n\nPublic Constructors\n-------------------\n\n#### public\n**Orthogonal**\n(Ops tf, long seed)\n\nCreates an Orthogonal Initializer using [GAIN_DEFAULT](/jvm/api_docs/java/org/tensorflow/framework/initializers/Orthogonal#GAIN_DEFAULT) for the gain. \n\n##### Parameters\n\n| tf | the TensorFlow Ops |\n| seed | the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype. |\n|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public\n**Orthogonal**\n(Ops tf, double gain, long seed)\n\nCreates an Orthogonal Initializer \n\n##### Parameters\n\n| tf | the TensorFlow Ops |\n| gain | the gain to be applied to the Matrix. |\n| seed | the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype. |\n|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e\n**call**\n([Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TInt64](/jvm/api_docs/java/org/tensorflow/types/TInt64)\\\u003e dims, Class\\\u003cT\\\u003e type)"]]