Multidimensional matrix 3x3x3x3 in 4D and its operations
Code: "matrix_4D.py". Programming language: Python
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/matrix_4D_4163.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
# This shows how to make a multi-demensional matrix using ND4J
from org.nd4j.linalg.api.ndarray import INDArray
from org.nd4j.linalg.factory import Nd4j;
from org.nd4j.linalg.ops.transforms import Transforms
# make 4D matrix with 3 rows and value 1
n = Nd4j.create(Nd4j.ones(81).data(), [3,3,3,3])
# transform to exp
ndv = Transforms.exp(n)
print n
print ndv
# make matrix 2x2 (empty)
nd = Nd4j.create([2, 2])
# make matrix 2x6
nd = Nd4j.create([1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.], [2, 6]);
print nd
# very large matrox
n = Nd4j.linspace(1,10000000,10000000)
# multiply it on transpose
print "MMUL=", n.mmul(n.transpose())
You see the box below because you did not login.