Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-jacob committed Jun 4, 2019
2 parents ecadc6e + 403c6df commit 05255f4
Show file tree
Hide file tree
Showing 37 changed files with 277 additions and 6 deletions.
3 changes: 3 additions & 0 deletions convlab/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The agent module
import numpy as np
import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions convlab/agent/algorithm/policy_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# Action policy module
# Constructs action probability distribution used by agent to sample action and calculate log_prob, entropy, etc.
from gym import spaces
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/algorithm/ppo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from copy import deepcopy
from convlab.agent import net
from convlab.agent.algorithm import policy_util
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/algorithm/random.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The random agent algorithm
# For basic dev purpose
from convlab.agent.algorithm.base import Algorithm
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/algorithm/reinforce.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent import net
from convlab.agent.algorithm import policy_util
from convlab.agent.algorithm.base import Algorithm
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/algorithm/sarsa.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent import net
from convlab.agent.algorithm import policy_util
from convlab.agent.algorithm.base import Algorithm
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/algorithm/sil.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent import net, memory
from convlab.agent.algorithm import policy_util
from convlab.agent.algorithm.actor_critic import ActorCritic
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/memory/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from abc import ABC, abstractmethod
from collections import deque
from convlab.lib import logger, util
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/memory/onpolicy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from collections import deque
from copy import deepcopy
from convlab.agent.memory.base import Memory
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/memory/prioritized.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent.memory.replay import Replay
from convlab.lib import util
from convlab.lib.decorator import lab_api
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/memory/replay.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from collections import deque
from copy import deepcopy
from convlab.agent.memory.base import Memory
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/net/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from abc import ABC, abstractmethod
from convlab.agent.net import net_util
import pydash as ps
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/net/conv.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent.net import net_util
from convlab.agent.net.base import Net
from convlab.lib import math_util, util
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/net/mlp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent.net import net_util
from convlab.agent.net.base import Net
from convlab.lib import math_util, util
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/net/net_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from functools import partial, wraps
from convlab.lib import logger, optimizer, util
import os
Expand Down
3 changes: 3 additions & 0 deletions convlab/agent/net/recurrent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.agent.net import net_util
from convlab.agent.net.base import Net
from convlab.lib import util
Expand Down
3 changes: 3 additions & 0 deletions convlab/env/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from abc import ABC, abstractmethod
from gym import spaces
from convlab.lib import logger, util
Expand Down
2 changes: 1 addition & 1 deletion convlab/env/movie.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modified by Microsoft Corporation.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

import io
Expand Down
2 changes: 1 addition & 1 deletion convlab/env/multiwoz.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modified by Microsoft Corporation.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

from copy import deepcopy
Expand Down
3 changes: 3 additions & 0 deletions convlab/experiment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The experiment module
# Handles experimentation logic: control, analysis
3 changes: 3 additions & 0 deletions convlab/experiment/analysis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from convlab.lib import logger, util, viz
from convlab.spec import random_baseline
import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions convlab/experiment/control.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The control module
# Creates and runs control loops at levels: Experiment, Trial, Session
from copy import deepcopy
Expand Down
3 changes: 3 additions & 0 deletions convlab/experiment/retro_analysis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The retro analysis module
# Runs analysis post-hoc using existing data files
# example: yarn retro_analyze data/reinforce_cartpole_2018_01_22_211751/
Expand Down
3 changes: 3 additions & 0 deletions convlab/experiment/search.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from copy import deepcopy
from convlab.lib import logger, util
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions convlab/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.
3 changes: 3 additions & 0 deletions convlab/lib/decorator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from functools import wraps
from convlab.lib import logger
import time
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/distribution.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# Custom PyTorch distribution classes to be registered in policy_util.py
# Mainly used by policy_util action distribution
from torch import distributions
Expand Down
3 changes: 2 additions & 1 deletion convlab/lib/file_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Modified by Microsoft Corporation.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

from pathlib import Path

from allennlp.common.file_utils import cached_path as allennlp_cached_path
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

import colorlog
import logging
import os
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/math_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# Various math calculations used by algorithms
import numpy as np
import torch
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/optimizer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# Custom PyTorch optimizer classes, to be registered in net_util.py
import math
import torch
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

from collections import deque
from contextlib import contextmanager
from datetime import datetime
Expand Down
3 changes: 3 additions & 0 deletions convlab/lib/viz.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Modified by Microsoft Corporation.
# Licensed under the MIT license.

# The data visualization module
# Defines plotting methods for analysis
from plotly import graph_objs as go, io as pio, tools
Expand Down
1 change: 0 additions & 1 deletion convlab/modules/policy/system/multiwoz/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def get_info_state(belief_state):
booking.append(0)
else:
if belief_state[domain]['book'][slot] != "":
print("domain {} booking set".format(domain))
booking.append(1)
else:
booking.append(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def get_info_state(self, belief_state):
booking.append(0)
else:
if belief_state[domain]['book'][slot] != "":
print("domain {} booking set".format(domain))
booking.append(1)
else:
booking.append(0)
Expand Down
1 change: 0 additions & 1 deletion convlab/modules/word_policy/multiwoz/mdrg/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def get_summary_bstate(bstate):
booking.append(0)
else:
if bstate[domain]['book'][slot] != "":
print("domain {} booking set".format(domain))
booking.append(1)
else:
booking.append(0)
Expand Down
Loading

0 comments on commit 05255f4

Please sign in to comment.