siat-nlp / ddmn Goto Github PK
View Code? Open in Web Editor NEWCode and data for the paper "Dual Dynamic Memory Network for End-to-End Multi-turn Task-oriented Dialog Systems".
License: Apache License 2.0
Code and data for the paper "Dual Dynamic Memory Network for End-to-End Multi-turn Task-oriented Dialog Systems".
License: Apache License 2.0
def update(self, metrics_list):
for i, metrics in enumerate(metrics_list):
num_samples = metrics.pop("num_samples", 1)
self.num_samples += num_samples
for key, val in metrics.items():
if val is not None:
key_turn = str(key) + "-turn-{}".format(str(i+1))
self.metrics_val[key_turn] = val
if isinstance(val, torch.Tensor):
val = val.item()
self.metrics_cum[key] += val * num_samples
elif isinstance(val, tuple):
assert len(val) == 2
val, num_words = val[0].item(), val[1]
self.metrics_cum[key] += np.array([val * num_samples, num_words])
else:
self.metrics_cum[key] += val * num_samples
Wanted to know the reason for scaling the metrics with the number of samples in the batch, and how can one compute the perplexity for the test set
你好,seq2seq.py: 386 是否不应该从属于gpu判断分支下面?
当不使用gpu时,selector_target和pad_zeros就不会放在一起,会报错
而且判断逻辑上也不太适合根据是否使用gpu来判断是否pad吧
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.