transformer icon indicating copy to clipboard operation
transformer copied to clipboard

How to set Positional encoding

Open flydephone opened this issue 3 years ago • 4 comments

I have a time-series dataset with day-scale resolution. When I set the pe = 'regular' # Positional encoding, Then I will get an error TypeError: generate_original_PE() got an unexpected keyword argument 'period So I can only use the regular PE, but I don't know how to set the pe_period. It seems that a pe_period = 24 are for dataset with Hour-scale resolution.

flydephone avatar Sep 23 '22 14:09 flydephone

Hi, thanks for reporting this issue, it should be fixed with 997b08e18fc06452a505d14c39f33294b4d9e65e.

maxjcohen avatar Sep 23 '22 14:09 maxjcohen

Thanks. By the way, I still want to know how to set the pe_period when I use the regular PE.

flydephone avatar Sep 23 '22 14:09 flydephone

I haven't gotten around to code this setting, fell free to send a PR if you've got the time to write it yourself. The function is defined here: https://github.com/maxjcohen/transformer/blob/997b08e18fc06452a505d14c39f33294b4d9e65e/tst/utils.py#L7-L29

maxjcohen avatar Sep 23 '22 15:09 maxjcohen

OK, I will figure out it.

flydephone avatar Sep 23 '22 15:09 flydephone