MCPcopy Create free account
hub / github.com/alexrame/fishr / Classifier

Function Classifier

domainbed/networks.py:198–207  ·  view source on GitHub ↗
(in_features, out_features, is_nonlinear=False)

Source from the content-addressed store, hash-verified

196
197
198def Classifier(in_features, out_features, is_nonlinear=False):
199 if is_nonlinear:
200 return torch.nn.Sequential(
201 torch.nn.Linear(in_features, in_features // 2),
202 torch.nn.ReLU(),
203 torch.nn.Linear(in_features // 2, in_features // 4),
204 torch.nn.ReLU(),
205 torch.nn.Linear(in_features // 4, out_features))
206 else:
207 return torch.nn.Linear(in_features, out_features)
208
209
210class WholeFish(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected