Comments (4)
Oh, that function was a utility that I quickly wrote to evaluate a model. It shouldn't be there. I've removed it.
To evaluate the perplexity of a model, you can pass 'perplexity' as a KERAS_METRIC
in config.py
. This is now done by default:
Line 32 in 5a29099
PS: it requires to update Keras.
from nmt-keras.
Got it, thanks. However, it only computes perplexity during training. Is there a way to compute perplexity on the validation set? I would like to have the metric_name
here be 'perplexity' rather than sacrebleu:
callbacks.append(PrintPerformanceMetricOnEpochEndOrEachNUpdates(nmt_model,
dataset,
gt_id='target_text',
metric_name=['sacrebleu'],
set_name=['val'],
batch_size=256,
each_n_epochs=20,
extra_vars=search_params,
reload_epoch=0,
is_text=True,
input_text_id=input_text_id,
index2word_y=vocab,
sampling_type='max_likelihood',
beam_search=True,
save_path=nmt_model.model_path,
start_eval_on_epoch=0,
write_samples=True,
write_type='list',
verbose=True))
Thanks again for the help.
from nmt-keras.
Added (MarcBS/multimodal_keras_wrapper@22d10a9).
You can now evaluate with Perpleixty as any other metric, e.g.:
METRICS = ['sacrebleu', 'perplexity']
You'll need to update multimodal-keras-wrapper
and nmt-keras
.
from nmt-keras.
Great, thank you.
from nmt-keras.
Related Issues (20)
- Support for Factored Models ? HOT 1
- consume long time for predicting validation output HOT 3
- Confusion with opennmt-tf HOT 1
- Missing auto setup of required packages for running this library HOT 1
- How to use pretrained word2vec embeddings? HOT 1
- Getting error index out of range when training a Transformer model HOT 10
- Using CPU for inference with GPU-trained model HOT 20
- Getting error when using Tensorboard HOT 2
- Save perplexity on training and validation sets HOT 5
- Regd Rare Words/OOV Tokens ? HOT 9
- Sampling decoding HOT 1
- Strange behavior with plotting metrics for validation HOT 2
- Issue with ensemble scoring method HOT 3
- AssertionError: Reduction function "Noam" unimplemented! HOT 1
- Data Error ? HOT 6
- Detecting multiple GPUs HOT 9
- Training Error HOT 1
- Conversion to TFJS HOT 1
- Example Colab Fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmt-keras.