Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ykeuter committed Nov 10, 2020
1 parent dee5f0a commit 18ec6bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
neat.log
2 changes: 1 addition & 1 deletion examples/simple/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def make_net(genome, config, bs):

def activate_net(net, states):
outputs = net.activate(states).numpy()
return outputs[:, 0] > 0.5
return (outputs[:, 0] > 0.5).astype(int)


@click.command()
Expand Down
2 changes: 1 addition & 1 deletion pytorch_neat/recurrent_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def dense_from_coo(shape, conns, dtype=torch.float64):
if len(idxs) == 0:
return mat
rows, cols = np.array(idxs).transpose()
mat[torch.tensor(rows), torch.tensor(cols)] = torch.tensor(
mat[torch.tensor(rows, dtype=torch.long), torch.tensor(cols, dtype=torch.long)] = torch.tensor(
weights, dtype=dtype)
return mat

Expand Down

0 comments on commit 18ec6bb

Please sign in to comment.