如何使用keras和自动编码器对numpy数组进行编码

时间:2019-11-23 06:39:38

标签: keras neural-network deep-learning autoencoder

我有一个像这样的numpy数组,

array([[ 9.10812400e-01,  7.55480960e+00,  5.85824600e+00,
    -1.63298620e-02, -4.18150200e-02, -7.58900800e-02],
   [ 7.93121340e-01,  7.59404000e+00,  5.81901550e+00,
    -1.63298620e-02, -4.18150200e-02, -7.58900800e-02],
   [ 7.73513800e-01,  7.35867300e+00,  6.03475950e+00,
     9.80464400e-02,  1.60981410e-03,  1.03224980e-02],
   [ 7.73513800e-01,  7.41751100e+00,  6.01515200e+00,
     9.80464400e-02,  1.60981410e-03,  1.03224980e-02],
   [ 8.32351700e-01,  7.14292900e+00,  6.36819460e+00,
     1.98594750e-01,  1.33242460e-01,  1.14474740e-01],
   [ 9.89257800e-01,  7.00563050e+00,  6.32896400e+00,
     1.98594750e-01,  1.33242460e-01,  1.14474740e-01],
   [ 1.69534300e+00,  7.61364750e+00,  7.87841800e+00,
    -7.01231800e-02,  7.94170350e-02,  1.17905500e-01],
   [ 5.77377300e-01,  7.75094600e+00,  6.56431600e+00,
    -1.82861970e-01,  2.53925120e-02,  1.51244830e-01],
   [ 1.16578670e+00,  7.47634900e+00,  7.42730700e+00,
    -2.52029870e-01,  8.80286700e-03,  2.21323560e-01],
   [ 1.49920650e+00,  7.26060500e+00,  7.34884640e+00,
    -2.52029870e-01,  8.80286700e-03,  2.21323560e-01],
   [ 1.81301880e+00,  7.08409100e+00,  7.40769960e+00,
    -2.52029870e-01,  8.80286700e-03,  2.21323560e-01],
   [ 1.83262630e+00,  6.98602300e+00,  7.32923900e+00,
    -2.77232860e-01,  5.01918570e-02,  1.12273335e-01],
   [ 1.75418090e+00,  7.00563050e+00,  7.46653750e+00,
    -2.77232860e-01,  5.01918570e-02,  1.12273335e-01],
   [ 1.06658936e-01,  8.16281100e+00,  5.56404100e+00,
    -4.09735530e-01, -1.65083600e-01,  4.19206840e-02],
   [ 4.79309080e-01,  8.35894800e+00,  5.62287900e+00,
    -2.90299700e-01, -2.74592130e-01,  8.11367500e-02],
   [ 2.63565060e-01,  8.24127200e+00,  5.36790470e+00,
    -2.90299700e-01, -2.74592130e-01,  8.11367500e-02]])

这个数组的形状是(16,6)

现在,我希望使用自动编码器嵌入此数组,并且输出形状可能会或可能不会像输入数组的形状(可以动态更改)。

如何使用keras做到这一点?

0 个答案:

没有答案