-
Notifications
You must be signed in to change notification settings - Fork 130
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
PyTorch search interface #1336
Comments
For me it would be fine to have nothing implemented, I prefer to take care of any processing and dumping myself in the forward_step, I would not even require a "search" task. |
Currently when the user puts Maybe to have it more distinct, we just introduce a new more generic But then still the question remains, how would the output(s) from |
Maybe the user can define some class ForwardCallbackIface:
def init(self): pass
def process_seq(self, seq_tag, outputs): pass
def finish(self): pass Or so. Then the user specifies If
class MyForwardCallback(ForwardCallbackIface):
def __init__(self):
self.out_file = None
def init(self):
self.out_file = gzip.open("recog.out.py.gz", "wt")
self.out_file.write("{\n")
def process_seq(self, seq_tag, outputs):
self.out_file.write(repr(seq_tag) + ": [%s],\n" % ...)
def finish(self):
self.out_file.write("}\n")
self.out_file.close() |
While this is very generic, maybe it's too complicated for the user? Is there some easier way for the user? (Which should still be straightforward to use.) Maybe for the |
Questions:
|
As there is no other suggestion, and we already waited here for almost a week, I'm going to implement those now. If you want to have anything different, please respond as soon as possible. |
This prepares for forward/search logic (#1336). Defines Engine.init_network_from_config such that the RETURNN main entry works.
This is for doing beam search inside RETURNN, e.g. for end-to-end models, e.g. AED.
This is when using the PyTorch engine (#1120).
Currently when the user uses
task = "search"
, ourmain
would callengine.search(...)
. This function is not implemented for the PT engine.Do we want to implement it?
In #1120, currently we discussed to have a very generic
forward_step
function, which can have any number of outputs. But we don't really have discussed how they would be used. Dumped to HDF? Dumped to a Python file similar as what we get via TFengine.search
? How would that be configured?The TF
engine.search
is more specific. Either the search output is behindDecideLayer
, so no beam anymore, then it will create a Python file with a dict seq_tag -> hyp. Or it is with beam, then it is a Python file with a dict seq_tag -> list of tuple hyp and score.Do we want to have sth as specific as that? So the user defines a
search_step
or so in the config?Or how exactly would we define in the config what would happen with the outputs from
forward_step
? All dumped to file? But this should be flexible enough to allow for a format exactly like the TF format. I.e. Python file with a dict seq_tag -> list of tuple hyp and score.The text was updated successfully, but these errors were encountered: