Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDP solving with LP #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

MDP solving with LP #17

wants to merge 1 commit into from

Conversation

silgon
Copy link

@silgon silgon commented Sep 29, 2015

  • Bug solved: Linear Programming was using Fortran Like Order which was sending wrong values to the h matrix
  • test_LP.py modified in order to test Linear Programming

…as sending wrong values to the h matrix

- test_LP.py modified in order to test Linear Programming
@silgon
Copy link
Author

silgon commented Sep 29, 2015

I didn't even have time to change the test_LP.py file author. If you add it please put @silgon in the file ;). I also have a question on how you created the files. Because it says Created on $date. Were they generated automatically? if so, how?

@silgon
Copy link
Author

silgon commented Sep 29, 2015

I know it's a pull request, but I also noticed something. You should also change this:

f = self._cvxmat(_np.ones((self.S, 1)))
h = _np.array(self.R).reshape(self.S * self.A, 1)
h = self._cvxmat(h, tc='d')
M = _np.zeros((self.A * self.S, self.S))
for aa in range(self.A):
   pos = (aa + 1) * self.S
   M[(pos - self.S):pos, :] = (
        self.discount * self.P[aa] - _sp.eye(self.S, self.S))
M = self._cvxmat(M)

to this:

f = self._cvxmat(_np.ones((self.S, 1)))
M = _np.zeros((self.A * self.S, self.S))
h = np.zeros((self.A * self.S,))
for aa in range(self.A):
    pos = (aa + 1) * self.S
    M[(pos - self.S):pos, :] = (
        self.discount * self.P[aa] - _sp.eye(self.S, self.S))
    # if R has dimensions (S, A)
    h[(pos - S):pos] = np.dot(P[aa], R[:, aa])
    # if R has dimensions (S,)
    # h[(pos - S):pos] = np.dot(P[aa], R)
M = self._cvxmat(M)
h = self._cvxmat(h, tc='d')

Look at the commented code, it should be probably a function that takes into account the dimension of R. Maybe I'll take some time later on to change it and then I do another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant