data.py 362 B

1234567891011121314
  1. import numpy as np
  2. seq_len = 128
  3. in_feat = 64
  4. in_batch = in_feat
  5. out_feat = in_feat
  6. f = open('input.txt', 'wt')
  7. f.write('%d %d\n'%(seq_len, in_feat))
  8. for i in range(seq_len):
  9. x = np.random.random(size=(in_feat, in_batch))
  10. np.savetxt(f, x, fmt='%.5f')
  11. for i in range(8):
  12. w = np.random.random(size=(out_feat, in_feat))
  13. np.savetxt(f, w, fmt='%.5f')