Skip to main content

Set of pytorch modules and utils to train code2seq model

Project description

code2seq

JetBrains Research Github action: build Code style: black

PyTorch's implementation of code2seq model.

Configuration

Use yaml files from config directory to configure all processes. model option is used to define model, for now repository supports:

  • code2seq
  • typed-code2seq
  • code2class

data_folder stands for the path to the folder with dataset. For checkpoints with predefined config, users can specify data folder by argument in corresponding script.

Data

Code2seq implementation supports the same data format as the original model. The only one different is storing vocabulary. To recollect vocabulary use

PYTHONPATH='.' python preprocessing/build_vocabulary.py

Train model

To train model use train.py script

python train.py model

Use main.yaml to set up hyper-parameters. Use corresponding configuration from configs/model to set up dataset.

To resume training from saved checkpoint use --resume argument

python train.py model --resume checkpoint.ckpt

Evaluate model

To evaluate trained model use test.py script

python test.py checkpoint.py

To specify the folder with data (in case on evaluating on different from training machine) use --data-folder argument

python test.py checkpoint.py --data-folder path

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code2seq-0.0.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

code2seq-0.0.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file code2seq-0.0.0.tar.gz.

File metadata

  • Download URL: code2seq-0.0.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for code2seq-0.0.0.tar.gz
Algorithm Hash digest
SHA256 f95d9d23fb9025eecb62b474ac0142df101b731a976b22d08083afcb2b5d97ce
MD5 632628b843a5ab495897ef46d5bde351
BLAKE2b-256 bfbac09ce6620f60be09205f396ce8e7c5192a4bd8ecfdbdd97bb8c1020fe6a6

See more details on using hashes here.

File details

Details for the file code2seq-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: code2seq-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for code2seq-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8869ae8c6432a07352e331d0a4f7308db176ee1e702e4cad3544526bf2a70902
MD5 3dadaa30bf304e2ec5ff46ab6b5ff699
BLAKE2b-256 94e18f3225ef85d796bd456d2104512a1a00a85659c4cf7046a876d4e250f970

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page