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

exchange_rate.txt #252

Open
JonathanHuangC opened this issue Oct 9, 2023 · 5 comments
Open

exchange_rate.txt #252

JonathanHuangC opened this issue Oct 9, 2023 · 5 comments

Comments

@JonathanHuangC
Copy link

What do the 8 columns in exchange_rate.txt represent?
Where did this data come from?
Thank you for your response.

@philipperemy
Copy link
Owner

@JonathanHuangC Good question. It comes from this repo. I've transferred your question.

laiguokun/multivariate-time-series-data#7

@JonathanHuangC
Copy link
Author

JonathanHuangC commented Oct 20, 2023

@philipperemy
Is there any example of using TCN to extract features?
For example, compressing the exchange rate of [1000 * 8] into [1 * 8], where 1000 represents the day and 8 is the feature of the data.
Thank you very much for your reply.

@philipperemy
Copy link
Owner

You mean some form of auto encoding? You can just search for LSTM features extraction and you swap the LSTM class with the TCN class and it should work.

@JonathanHuangC
Copy link
Author

You mean some form of auto encoding? -> Yes, it seems to be using TCN to implement the auto encoder.

Do you mean that it is enough to change LSTM to TCN? Sorry for there are a lot of questions.

Thank you again for your reply.

LSTM autoencoder

define model

model = Sequential()

Encoder step

model.add(LSTM(15, input_shape=(X_train.shape[1], X_train.shape[2]), activation='relu'))
model.add(RepeatVector(X_train.shape[1]))

Decoder step

model.add(LSTM(15, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(X_train.shape[2])))

model.compile(optimizer='adam', loss='mse')

history = model.fit(X_train, X_train, epochs=_epochs, batch_size = _batch_size,
validation_split=_validation_split, callbacks=callback)

TCN autoencoder

define model

model = Sequential()

Encoder step

model.add(TCN(15, input_shape=(X_train.shape[1], X_train.shape[2]), activation='relu'))
model.add(RepeatVector(X_train.shape[1]))

Decoder step

model.add(TCN(15, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(X_train.shape[2])))

model.compile(optimizer='adam', loss='mse')

history = model.fit(X_train, X_train, epochs=_epochs, batch_size = _batch_size,
validation_split=_validation_split, callbacks=callback)

@philipperemy
Copy link
Owner

yeah it's as easy as swapping the class.

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

2 participants