Skip to content

Commit

Permalink
Support Gram with trailing delim
Browse files Browse the repository at this point in the history
  • Loading branch information
rfriedman22 committed Mar 17, 2020
1 parent f86a567 commit fb11951
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preimage/kernels/generic_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def set_gram_matrix_from_file(self, filename, delim="\t", lower_triangle=True):
gram_matrix = np.eye(n_lines)
with open(filename) as fin:
for row, line in enumerate(fin):
line = map(float, line.split(delim))
line = map(float, line.strip().split(delim))
for col, val in enumerate(line):
if row != col:
gram_matrix[row, col] = val
Expand Down

0 comments on commit fb11951

Please sign in to comment.