Skip to content

Commit

Permalink
fix indent of polarity.py again
Browse files Browse the repository at this point in the history
  • Loading branch information
zjzzqs committed Apr 26, 2020
1 parent fdd82e1 commit a460dc9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/yews/models/polarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def polarity_v1(pretrained=False, progress=True, **kwargs):
`"Deep learning for ..." <https://arxiv.org/abs/1901.06396>`_ paper. The
pretrained model is trained on 60,000 Wenchuan aftershock dataset
demonstrated in the paper.
Args:
pretrained (bool): If True, returns a model pre-trained on Wenchuan)
progress (bool): If True, displays a progress bar of the download to stderr
Expand All @@ -128,7 +127,6 @@ def polarity_v1(pretrained=False, progress=True, **kwargs):
model.load_state_dict(state_dict)
return model


class PolarityV2(nn.Module):

#https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py
Expand Down Expand Up @@ -259,13 +257,13 @@ def polarity_lstm(**kwargs):
"bidirectional":False,
"contains_unkown":False}
for k,v in kwargs.items():
if k in default_kwargs:
default_kwargs[k] = v
if k in default_kwargs:
default_kwargs[k] = v
print("#### model parameters ####\n")
print(default_kwargs)
print("\n##########################")
if(default_kwargs['end'] < default_kwargs['start']):
raise ValueError('<-- end cannot be smaller than start -->')
raise ValueError('<-- end cannot be smaller than start -->')
model = PolarityLSTM(**default_kwargs)
return model

Expand All @@ -274,4 +272,4 @@ def polarity_lstm(**kwargs):

# x = torch.ones([1, 1, 600])
# out = model(x)
# print(out.size())
# print(out.size())

0 comments on commit a460dc9

Please sign in to comment.