cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.87k stars 177 forks source link

How to handle scalar (context)? #92

Closed jmrichardson closed 4 years ago

jmrichardson commented 4 years ago

Thank you for mcfly, it is very helpful. I have a question regarding adding scalar inputs. I would like to to include contextual data in each subsequence without just making a feature of all the same value. Is this possible? For example, lets say I have a training set of shape:

20, 50, 5

For each of the 20 samples, I would like to include a scalar value indicating context for example (0 or 1).

Thanks for any advice

cantino commented 4 years ago

I'm sorry, I don't understand this question. How are you using mcfly?

jmrichardson commented 4 years ago

@cantino I am currently using mcfly the way that is documented in the examples and everything is working great. In my use case, I am feeding mcfly with financial price time series data for example MSFT open, high, low, close on a minute basis. However, I also have contextual data for example daily or weekly data. For example, I may have an interest rate value that I would like to feed into the model that would change on an irregular basis. The seglearn package refers to this as contextual data and has the ability to include in the model (here). Instead of having a feature called intrate that would be constant on a minute basis, is there a way to feed this scalar into the model using mcfly? After some research online, it appears that some folks engineer it into the layers:

Other popular methods of pulling this off usually inject scalar outputs after all the convolutional layers, when the last feature map has been flattened and the fully connected layers start, it is easy to concatenate in some auxiliary scalar inputs.

https://www.reddit.com/r/MLQuestions/comments/8euewm/how_to_combine_matrix_and_scalar_inputs_in_a_conv/

Thanks

cantino commented 4 years ago

I'm pretty sure you're talking about a different mcfly project.

jmrichardson commented 4 years ago

whooops... sorry, yes wrong mcfly:

https://github.com/NLeSC/mcfly

Thanks anyways :)

cantino commented 4 years ago

That makes more sense ;)

On Sat, Jul 18, 2020 at 12:31 PM jmrichardson notifications@github.com wrote:

whooops... sorry, yes wrong mcfly:

https://github.com/NLeSC/mcfly

Thanks anyways :)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/cantino/mcfly/issues/92#issuecomment-660530896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUO67DYST4TXNAIZMRFD3R4H2CFANCNFSM4O7FYMGA .