Skip to content

Commit

Permalink
PyTorch demo (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Sep 12, 2022
1 parent 6051f8a commit 50673bd
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions demos/demo-torch.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!returnn.py
# kate: syntax python;
# -*- mode: python -*-
# sublime: syntax 'Packages/Python Improved/PythonImproved.tmLanguage'
# vim:set expandtab tabstop=4 fenc=utf-8 ff=unix ft=python:

import os
from returnn.util.basic import get_login_username

demo_name, _ = os.path.splitext(__file__)
print("Hello, experiment: %s" % demo_name)

backend = "torch"

task = "train"
train = {"class": "Task12AXDataset", "num_seqs": 1000}
dev = {"class": "Task12AXDataset", "num_seqs": 100, "fixed_random_seed": 1}

num_inputs = 9
num_outputs = 2
batching = "random"
batch_size = 5000
max_seqs = 10
chunking = "200:200"

# TODO define network and loss...

# training
# TODO maybe remove this...
optimizer = {"class": "adam"}
learning_rate = 0.01

model = "/tmp/%s/returnn/%s/model" % (get_login_username(), demo_name)
num_epochs = 5

# log
#log_verbosity = 3
log_verbosity = 5

0 comments on commit 50673bd

Please sign in to comment.