Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase # of Layers with CfC or LTC Cell #75

Open
Mariam-124 opened this issue Sep 13, 2024 · 0 comments
Open

How to increase # of Layers with CfC or LTC Cell #75

Mariam-124 opened this issue Sep 13, 2024 · 0 comments

Comments

@Mariam-124
Copy link

Hi , This is my model where I want to use two layers of CfC , however with one layer this works fine when I add a second layer thus code gives error. Please mention how I can use stacking.

Build the CfC model

wiring = wirings.FullyConnected(25, 6) #25 total Neurons and 6 output
model = tf.keras.models.Sequential([
tf.keras.layers.InputLayer(input_shape=(4, 30)), # 4 Lookback time steps, 30 features
CfC(wiring, return_sequences=True), # CfC Layer 1
CfC(wiring, return_sequences=False), # CfC Layer 2
tf.keras.layers.Dense(units=6 , activation='relu') # Output 6 predictions (for 6 wind sites)
])

Compile the model

model.compile(optimizer=tf.keras.optimizers.Adam(0.001), loss='mean_squared_error')
model.summary()

Error:

**File ~\anaconda\Lib\site-packages\ncps\wirings\wirings.py:39, in Wiring.build(self, input_dim)
37 def build(self, input_dim):
38 if not self.input_dim is None and self.input_dim != input_dim:
---> 39 raise ValueError(
40 "Conflicting input dimensions provided. set_input_dim() was called with {} but actual input has dimension {}".format(
41 self.input_dim, input_dim
42 )
43 )
44 if self.input_dim is None:
45 self.set_input_dim(input_dim)

ValueError: Conflicting input dimensions provided. set_input_dim() was called with 30 but actual input has dimension 6**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant