Bihaqo / t3f

Tensor Train decomposition on TensorFlow
https://t3f.readthedocs.io/en/latest/index.html
MIT License
218 stars 56 forks source link

Add sparse initializer #181

Open Bihaqo opened 5 years ago

Bihaqo commented 5 years ago

Something like

def sparse(idx, n):
  cores = []
  eye = tf.eye(n)
  for k in range(len(idx)):
    cores.append(tf.reshape(eye[idx[k]], (1, n, 1)))
  return t3f.TensorTrain(cores)