Home | Trees | Indices | Help |
---|
|
object --+ | BaseStartVector --+ | OnesStartVector
A start vector of ones. Parameters ---------- normalise : Bool. If True, normalise the randomly created vectors Default is False Examples -------- >>> from parsimony.utils.start_vectors import OnesStartVector # Without normalization >>> start_vector = OnesStartVector(normalise=False) >>> ones = start_vector.get_vector(3) >>> print ones [[ 1.] [ 1.] [ 1.]] >>> print maths.norm(ones) 1.73205080757 # With normalization >>> start_vector_normalized = OnesStartVector(normalise=True) >>> ones_normalized = start_vector_normalized.get_vector(3) >>> print ones_normalized [[ 0.57735027] [ 0.57735027] [ 0.57735027]] >>> print maths.norm(ones_normalized) 1.0
|
|||
Inherited from |
|
|||
|
|||
|
|||
Inherited from |
|
|||
__abstractmethods__ =
|
|||
Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Return vector of ones of chosen shape Parameters ---------- size : Positive integer. Size of the vector to generate. The shape of the output is (size, 1). Examples -------- >>> from parsimony.utils.start_vectors import OnesStartVector >>> start_vector = OnesStartVector() >>> ones = start_vector.get_vector(3) >>> print ones [[ 1.] [ 1.] [ 1.]]
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:11 2015 | http://epydoc.sourceforge.net |