Skip to content

Commit fccb68f

Browse files
0.10.2
rnn alpha
1 parent 80a54b7 commit fccb68f

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotPython"
10-
version = "0.10.1"
10+
version = "0.10.2"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/light/regression/rnnlightregression.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def __init__(
145145
# Initialize RNN
146146
# input_size = number of features (= 11)
147147
# num_layers=1: only a single RNN and not stacked
148-
rnn_units = self.hparams.l1
149-
fc_units = self.hparams.l1
148+
rnn_units = 64 #self.hparams.l1
149+
fc_units = 64 # self.hparams.l1
150150

151151
# TODO: make this a hyperparameter
152152
rnn_nonlinearity = "relu"
@@ -163,7 +163,8 @@ def __init__(
163163

164164
# Initialize Hidden- and Output-Layer
165165
self.fc = nn.Linear(rnn_units, fc_units)
166-
self.output_layer = nn.Linear(fc_units, self._L_out)
166+
# self.output_layer = nn.Linear(fc_units, self._L_out)
167+
self.layers =nn.Linear(fc_units, self._L_out)
167168

168169
# Initialize Activation Function and Dropouts
169170
# self.dropout1 = nn.Dropout(dropout[0])
@@ -174,8 +175,9 @@ def __init__(
174175
self.dropout2 = nn.Dropout(self.hparams.dropout_prob // 10.0)
175176
self.dropout3 = nn.Dropout(self.hparams.dropout_prob // 100.0)
176177

177-
# self.activation_fct = activation_fct
178-
self.activation_fct = self.hparams.act_fn
178+
activation_fct = nn.ReLU()
179+
self.activation_fct = activation_fct
180+
# self.activation_fct = self.hparams.act_fn
179181

180182
# old:
181183
# if self.hparams.l1 < 4:
@@ -209,21 +211,21 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
209211
torch.Tensor: A tensor containing the output of the model.
210212
211213
"""
212-
print(f"input: {x.shape}")
214+
# print(f"input: {x.shape}")
213215
x = self.dropout1(x)
214-
print(f"dropout1: {x.shape}")
216+
# print(f"dropout1: {x.shape}")
215217
x, _ = self.rnn_layer(x)
216-
print(f"rnn_layer: {x.shape}")
217-
x = x[:, -1, :]
218-
print(f"slicing: {x.shape}")
218+
# print(f"rnn_layer: {x.shape}")
219+
# x = x[:, -1, :]
220+
# print(f"slicing: {x.shape}")
219221
x = self.dropout2(x)
220-
print(f"dropout2: {x.shape}")
222+
# print(f"dropout2: {x.shape}")
221223
x = self.activation_fct(self.fc(x))
222-
print(f"activation_fct: {x.shape}")
224+
# print(f"activation_fct: {x.shape}")
223225
x = self.dropout3(x)
224-
print(f"dropout3: {x.shape}")
226+
# print(f"dropout3: {x.shape}")
225227
x = self.output_layer(x)
226-
print(f"output_layer: {x.shape}")
228+
# print(f"output_layer: {x.shape}")
227229
return x
228230

229231
# old:

0 commit comments

Comments
 (0)