Skip to content

MLP Changes #123

@tedmoore

Description

@tedmoore

In MLP.py, this could be a dict lookup (which is faster and easier on the eyes) than a bunch of elifs:

for i, vals in enumerate(layers):
print(f"Layer {i}: {vals}")
val, activation = vals
if activation is not None:
if activation == 'relu':
activation = nn.ReLU()
elif activation == 'sigmoid':
activation = nn.Sigmoid()
elif activation == 'tanh':
activation = nn.Tanh()
else:
raise ValueError("Activation function not recognized.")
layers[i] = [val, activation]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions