Skip to content

Commit

Permalink
Merge branch 'main' into working-with-stormpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapfff committed Sep 16, 2022
2 parents 61ab12d + 40ea452 commit 9fa513c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions demo.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import jajapy as ja

from numpy import array

def modelMC_REBER():
s0 = ja.MC_state([[1.0],[1],['B']],0)
s1 = ja.MC_state([[0.5,0.5],[2,3],['T','P']],1)
s2 = ja.MC_state([[0.6,0.4],[2,4],['S','X']],2)
s3 = ja.MC_state([[0.7,0.3],[3,5],['T','V']],3)
s4 = ja.MC_state([[0.5,0.5],[3,6],['X','S']],4)
s5 = ja.MC_state([[0.5,0.5],[4,6],['P','V']],5)
s6 = ja.MC_state([[1.0],[6],['E']],6)
return ja.MC([s0,s1,s2,s3,s4,s5,s6],0,"MC_REBER")
alphabet = list("BTPSXVE")
initial_state = 0
nb_states = 7
s0 = ja.MC_state([(1,'B',1.0)],alphabet,nb_states)
s1 = ja.MC_state([(2,'T',0.5),(3,'P',0.5)],alphabet,nb_states)
s2 = ja.MC_state([(2,'S',0.6),(4,'X',0.4)],alphabet,nb_states)
s3 = ja.MC_state([(3,'T',0.7),(5,'V',0.3)],alphabet,nb_states)
s4 = ja.MC_state([(3,'X',0.5),(6,'S',0.5)],alphabet,nb_states)
s5 = ja.MC_state([(4,'P',0.5),(6,'V',0.5)],alphabet,nb_states)
s6 = ja.MC_state([(6,'E',1.0)],alphabet,nb_states)
matrix = array([s0,s1,s2,s3,s4,s5,s6])
return ja.MC(matrix,alphabet,initial_state,"MC_REBER")

original_model = modelMC_REBER()

Expand Down
2 changes: 1 addition & 1 deletion jajapy/base/BW.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _generateHhat(self):
pass

def _runProcesses(self,training_set):
if platform != "win32":
if platform != "win32" and platform != "darwin":
p = Pool(processes = NB_PROCESS)
tasks = []
for seq,times in zip(training_set.sequences,training_set.times):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
packages=find_packages(),
install_requires=['numpy', 'scipy'],
long_description_content_type="text/markdown",
version='0.5',
version='0.5.1',
url="",
description='Baum-Welch for all kind of Markov model',
author='Raphaël Reynouard',
Expand Down

0 comments on commit 9fa513c

Please sign in to comment.