Skip to content

Commit

Permalink
Remove a misleading (unused) attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
cgpotts committed Feb 29, 2020
1 parent 44f5e00 commit 8461455
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions torch_rnn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ class TorchRNNClassifier(TorchModelBase):
bidirectional : bool
If True, then the final hidden states from passes in both
directions are used.
hidden_activation : vectorized activation function
The non-linear activation function used by the network for the
hidden layer. Default `nn.Tanh()`.
max_iter : int
Maximum number of training epochs.
eta : float
Expand Down Expand Up @@ -165,6 +162,10 @@ def __init__(self,
self.bidirectional = bidirectional
super(TorchRNNClassifier, self).__init__(**kwargs)
self.params += ['embed_dim', 'embedding', 'use_embedding', 'bidirectional']
# The base class has this attribute, but this model doesn't,
# so we remove it to avoid misleading people:
delattr(self, 'hidden_activation')
self.params.remove('hidden_activation')

def build_dataset(self, X, y):
X, seq_lengths = self._prepare_dataset(X)
Expand Down

0 comments on commit 8461455

Please sign in to comment.