Killed some bugs and stuff
This commit is contained in:
parent
6e6a390a3a
commit
e52a1e1bd6
2
train.py
2
train.py
@ -306,7 +306,7 @@ def main(argv=None):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Model preparation
|
# Model preparation
|
||||||
module = PetriDashNet(
|
module = PetriDishNet(
|
||||||
n_in=args.n_elems,
|
n_in=args.n_elems,
|
||||||
n_neurons=args.n_hidden,
|
n_neurons=args.n_hidden,
|
||||||
n_out=1,
|
n_out=1,
|
||||||
|
5
utils.py
5
utils.py
@ -54,7 +54,7 @@ class ParityDataset(Dataset):
|
|||||||
|
|
||||||
y = (x == 1.0).sum() % 2
|
y = (x == 1.0).sum() % 2
|
||||||
|
|
||||||
return x, y
|
return x, torch.stack([y])
|
||||||
|
|
||||||
|
|
||||||
class PetriDishNet(nn.Module):
|
class PetriDishNet(nn.Module):
|
||||||
@ -110,8 +110,7 @@ class PetriDishNet(nn.Module):
|
|||||||
alpha=0.1,
|
alpha=0.1,
|
||||||
max_size=1e8)
|
max_size=1e8)
|
||||||
|
|
||||||
self.ionDucts = ActivationSparsity(n_neurons,
|
self.ionDucts = ActivationSparsity(alpha=0.1,
|
||||||
alpha=0.1,
|
|
||||||
beta=1.5,
|
beta=1.5,
|
||||||
act_sparsity=0.65)
|
act_sparsity=0.65)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user