Embedding Policy Results

rasa-core
alan

(Alan Nichol) #1

Hi Everyone!

Our new paper about the embedding policy (aka REDP) is now available: [1811.11707] Few-Shot Generalization Across Dialogue Tasks - we’ll present it at the NeurIPS conversational AI workshop next week.

There’s a blog post here that explains what the paper is about, and why it matters to Rasa developers. Let me know what you think!

Have you been using the Embedding Policy? We’d love to hear about your results, so let’s start a thread here.

:v:


(Nico) #2

This policy looks very promising :+1:

I tried to train my model, but it needs some serious processing power to even finish one epoch. Is this expected?

I am using the same hyperparams as in you paper.


(Datisto) #3

For the new Embedding you need to train stories with those chitchats and corrections. So, where is now the advantage/improvement compared to normal LSTM? Is it that you need way less stories to write such unccooperative stories, because attention layer learns not to pay attention to this part and will generalise to stories not trained?


(Asokolow) #4

Hi! Great feature :slight_smile:

Did you benchmark the training time ? I’m currently training a model by using this policy on a GTX 1080ti (12go) + 32Go ram + 32 core CPU and each epoch takes about ~10 min …

I’m using : policies:

- name: EmbeddingPolicy

epochs: 2000

attn_shift_range: 5

EDIT: I’ll answer my own question : the EmbeddingPolicy should be use with --augmentation 0


(Alan Nichol) #5

yes that’s a good description :slight_smile: the point of the policy is that it can learn to re-use those patterns from just a few examples


(Alan Nichol) #6

yes! the attention mechanisms definitely require more computer power to train. You can also switch off one (or both) of the attentions to swap a bit of generalization power for compute time


(Azizullah) #7

@amn41 its computation is much greater then normal LSTM, and we have to write the same incoperative stories. I do not get it less number of stories.

What its advantages to use it ? It has same result in my case. LSTM 300 epochs Embedding 2000 epochs.


(Adrian Humphrey) #8

Is this supposed to take 30 minutes to train on 2000 epochs??


(Azizullah) #9

@adrianhumphrey111 has already given the answer. the EmbeddingPolicy should be use with --augmentation 0 –augmentation 0 add this in your command while training


(Adrian Humphrey) #10

can you please give me an example for both command line and the python file way of doing that?


(Azizullah) #11
python -m rasa_core.train -s data/stories.md -d domain.yml -o models/dialogue  -c policy.yml --augmentation 0

(Adrian Humphrey) #12

Running this causes this output:

/usr/local/lib/python3.6/site-packages/pykwalify/core.py:99: UnsafeLoaderWarning: The default ‘Loader’ for ‘load(stream)’ without further arguments can be unsafe. Use ‘load(stream, Loader=ruamel.yaml.Loader)’ explicitly if that is OK. Alternatively include the following in your code:

  import warnings
  warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)'
  data = yaml.load(stream)
Processed Story Blocks: 100%|██████████████████████████████████████████████████████████████████████████████| 26/26 [00:00<00:00, 2419.24it/s, # trackers=16]
2019-01-07 08:22:41 INFO     rasa_core.agent  - Model directory models/dialogue/ exists and contains old model files. All files will be overwritten.
2019-01-07 08:22:41 INFO     rasa_core.agent  - Persisted model to '/app/kiddiecommute 2/models/dialogue'

I do not see it going over any epochs. Inside of my models/diaglogue folder, I only have the files:

domain.json           
domain.yml           
 policy_metadata.json

I do not see any models, or policy files


(Azizullah) #13

creat a file policy,yml

policies:
  - name: EmbeddingPolicy
    epochs: 2000
    attn_shift_range: 5

paste this.


(Adrian Humphrey) #14

That is exactly what I have already, could I see what the output would look like?