Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. def read_input_1c():
  2.  
  3. f = open('data/decode_input.txt','r')
  4.  
  5. lines = f.read().splitlines()
  6.  
  7. #print(len(lines))
  8. #print(lines)
  9.  
  10. X = lines[:100*128]
  11. #print(len(X))
  12.  
  13. X = np.array(X,dtype = np.float64).reshape((100,128)) # X contains 100 letters of size 128 bits each i.e. 100*128
  14. #print(X.shape[0])
  15.  
  16. W = lines[100*128:100*128+26*128]
  17.  
  18. W = np.array(W,dtype = np.float64).reshape((26,128)) # W contains the weights for each of the 26 letters at each of the 128 pixels
  19. #print(W[0][0])
  20.  
  21.  
  22. T = lines[100*128+26*128:]
  23. T = np.array(T, dtype = np.float64).reshape((26,26)) # T contains the transitions weights for every pair of letters (non-symmetric).
  24. #print(T[0][0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement