Fix examples
This commit is contained in:
parent
42ddd2e569
commit
1695fc5075
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package space.kscience.kmath.tensors
|
package space.kscience.kmath.tensors
|
||||||
|
|
||||||
|
import space.kscience.kmath.operations.invoke
|
||||||
import space.kscience.kmath.tensors.core.DoubleTensor
|
import space.kscience.kmath.tensors.core.DoubleTensor
|
||||||
import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra
|
import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra
|
|||||||
fun main () {
|
fun main () {
|
||||||
|
|
||||||
// work in context with linear operations
|
// work in context with linear operations
|
||||||
DoubleLinearOpsTensorAlgebra {
|
DoubleLinearOpsTensorAlgebra.invoke {
|
||||||
|
|
||||||
// set true value of x
|
// set true value of x
|
||||||
val trueX = fromArray(
|
val trueX = fromArray(
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package space.kscience.kmath.tensors
|
package space.kscience.kmath.tensors
|
||||||
|
|
||||||
|
import space.kscience.kmath.operations.invoke
|
||||||
import space.kscience.kmath.tensors.core.DoubleTensor
|
import space.kscience.kmath.tensors.core.DoubleTensor
|
||||||
import space.kscience.kmath.tensors.core.algebras.DoubleAnalyticTensorAlgebra
|
import space.kscience.kmath.tensors.core.algebras.DoubleAnalyticTensorAlgebra
|
||||||
import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra
|
import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra
|
||||||
@ -18,7 +19,7 @@ fun main() {
|
|||||||
val randSeed = 100500L
|
val randSeed = 100500L
|
||||||
|
|
||||||
// work in context with linear operations
|
// work in context with linear operations
|
||||||
DoubleLinearOpsTensorAlgebra {
|
DoubleLinearOpsTensorAlgebra.invoke {
|
||||||
// take coefficient vector from normal distribution
|
// take coefficient vector from normal distribution
|
||||||
val alpha = randNormal(
|
val alpha = randNormal(
|
||||||
intArrayOf(5),
|
intArrayOf(5),
|
||||||
|
Loading…
Reference in New Issue
Block a user