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

data format for regression task #29

Open
r-matsuzaka opened this issue Mar 1, 2022 · 2 comments
Open

data format for regression task #29

r-matsuzaka opened this issue Mar 1, 2022 · 2 comments

Comments

@r-matsuzaka
Copy link

Hi.
I wanna try regression task similar to prsa.
For prsa, I understand the data for training is prepared in dataset/prsa.py.
For other new regression task, where and how can I set the target value and feature data?

@ianbenlolo
Copy link

+1

@ianbenlolo
Copy link

Loading the model for me looks something like

from transformers.modeling_utils import load_sharded_checkpoint

tab_net = TabFormerBertLM(custom_special_tokens,
                       vocab=vocab,
                       field_ce=args.field_ce,
                       flatten=args.flatten,
                       ncols=dataset.ncols,
                       field_hidden_size=args.field_hs
                       )
load_sharded_checkpoint(tab_net.model, base_path+"checkpoints1/checkpoint-80/")

I need that i guess because the model is sharded when saved in my case.

It seems like to generate the dataset, load the model and predict. The the output is of shape (dset_size, seq_len*ncols, vocab_size) which i think can be reshaped to (dset_size, seq_len, -1) for prediction.

I think from there you simply pass the dataloader return_labels=True and then run a regression task somehow.
I would love any tips from the authors if possible.

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