Comments (5)
@jmrichardson Hum it means that the network does not learn anything if the classes are well-balanced (50% chance of having 0, and 50% of having 1). Why don't you try another simple model? Are your features spatially correlated like an image? Because TCN is based on convolutions.
from keras-tcn.
Sorry, I assumed that we could use keras-tcn for multivariate tabular data since I saw an example in your repo for a univariate data set. I am learning more about CNNs and see that the filters convolve around image data to detect things like edges for images. Since my data set features are temporal (not IID) but not images I don't think I can use keras-tcn correct?
from keras-tcn.
@jmrichardson no you can here. If your data has shape (batch-size, timestep, input-dim), you can use a TCN. For example if you have 64 time series with 1000 time steps, you can use TCN. Your input will be (batch-size, 1000, 64). TCN uses 1-D convolutions.
from keras-tcn.
I think I have the right data shape... I have 83 time series with 31K rows. I used the following code to create a rolling window of 20 sequences/timesteps similar to your milk task example:
lookback_window = 20
# Get training data
X_train = np.array(X_train_split)
y_train = np.array(y_train_split)
x, y = [], []
for i in range(lookback_window, len(X_train)):
x.append(X_train[i - lookback_window:i])
y.append(y_train[i])
X_train = np.array(x)
y_train = np.array(y)
# Get validation data
X_val = np.array(X_val_split)
y_val = np.array(y_val_split)
x, y = [], []
for i in range(lookback_window, len(X_val)):
x.append(X_val[i - lookback_window:i])
y.append(y_val[i])
X_val = np.array(x)
y_val = np.array(y)
Here is the shape X_train shape:
print(X_train.shape)
print(y_train.shape)
(31066, 20, 83)
(31066,)
Here is the model code:
model = compiled_tcn(return_sequences=False,
num_feat=X_train.shape[2],
num_classes=2,
nb_filters=24,
kernel_size=8,
dilations=[2 ** i for i in range(9)],
nb_stacks=1,
max_len=X_train.shape[1],
use_skip_connections=True,
)
model.fit(X_train, y_train, validation_data=(X_val, y_val), epochs=1, batch_size=256)
from keras-tcn.
Sorry I don't have much time to look at code snippets. I don't see any errors here. Don't hesitate to post your question on a machine learning forum. I'll close this issue as I don't see any bugs here. Thanks!
from keras-tcn.
Related Issues (20)
- ValueError: Unknown layer: TCN when trying to load saved model HOT 3
- Dilations and nb_stack relationship HOT 4
- The parameter of the TCN HOT 7
- Masking time steps in order to use TCN for variable length sequences HOT 2
- data shape of tcn layer HOT 1
- help one regression per sequence HOT 1
- Ensuring unique weights when a model uses multiple TCNs HOT 2
- Question: TCN Dilated Convolutions? HOT 3
- How can i use TCN to build seq2seq model? HOT 1
- keras-tcn for R HOT 3
- Visualization of internal structure of TCN block HOT 1
- Low accuracy in keras-tuner based TCN model for audio classification HOT 6
- Saving a loaded model gets warning and then fails to open HOT 1
- exchange_rate.txt HOT 5
- Question: Skip connections HOT 2
- Why is the data form (batch_size, timesteps, input_dim) instead less accurate than (batch_size, input_dim, timesteps)?
- Keras 3 support HOT 7
- Confusion about regression or classification head HOT 1
- AttributeError: 'tuple' object has no attribute 'as_list' HOT 3
- Question regarding return_sequences=True HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-tcn.