Skip to content
Snippets Groups Projects
Commit 2d0b9585 authored by Christian's avatar Christian
Browse files

small bugfix when using sgd for mle since sgd has no booked information and...

small bugfix when using sgd for mle since sgd has no booked information and not the full belief state is given in the dataset
parent ffb3dc42
Branches
No related tags found
Loading
......@@ -105,6 +105,7 @@ class PolicyDataVectorizer:
state['terminated'] = data_point['terminated']
if self.dst is not None and state['terminated']:
self.dst.init_session()
if "booked" in data_point:
state['booked'] = data_point['booked']
dialogue_act = flatten_acts(data_point['dialogue_acts'])
......
......@@ -47,8 +47,15 @@ class VectorBinary(VectorBase):
opp_act_vec = self.vectorize_user_act(state)
last_act_vec = self.vectorize_system_act(state)
belief_state, domain_active_dict = self.vectorize_belief_state(state, domain_active_dict)
if "booked" in state:
book = self.vectorize_booked(state)
else:
book = []
if self.db is not None:
degree, number_entities_dict = self.pointer()
else:
degree = []
number_entities_dict = {}
final = 1. if state['terminated'] else 0.
state_vec = np.r_[opp_act_vec, last_act_vec,
......@@ -82,6 +89,7 @@ class VectorBinary(VectorBase):
belief_state = np.zeros(self.belief_state_dim)
i = 0
for domain in self.belief_domains:
if domain in state['belief_state']:
for slot, value in state['belief_state'][domain].items():
if value:
belief_state[i] = 1.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment