Skip to content

spacing #2

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CreateBash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
work_list = list(range(9,57,4))





with open(output_name, "w") as f:
for w in work_list:
#f.write('python RotateLearning.py prepare-datasets-flt -W {}\n'.format(w))
Expand Down
12 changes: 1 addition & 11 deletions DATASET.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def generateDS(self, output, mask, w = WindowSize, choosy = False, ratio = 1.0,
return [X,Y, IDX]



def generateDSwithFilter(self, dstype, output, mask, w = WindowSize, choosy = False, ratio = 1.0):
# When choosy = TRUE : it only picks the fault locations and labels are based on fault angels
# ratio coresponds to randomly selecting all possible locations
Expand Down Expand Up @@ -208,8 +207,6 @@ def generateDSwithFilter(self, dstype, output, mask, w = WindowSize, choosy = Fa
return [X,Y, IDX]




def shrinkMask(self, maskName = 'train', number = 9):
# Shrink mask into 1/9 and return 9 masks:

Expand Down Expand Up @@ -243,8 +240,6 @@ def shrinkMask(self, maskName = 'train', number = 9):
return m




def evaluate(self, _pmap, expand=0, mask = 'all', etype = 'our'):
pmap = np.array(_pmap)
labels = self.expandBy(width=expand, epsilon=0.9 ,type='normal', set=False)
Expand All @@ -264,26 +259,21 @@ def evaluate(self, _pmap, expand=0, mask = 'all', etype = 'our'):
pmap[np.where(self.MASK == 0)] = 0



if etype == 'our':
IDX_pos = labels > 0
differror = np.square(labels - pmap)
differror[~IDX_pos] = 0
pos_score = differror.sum() / IDX_pos.sum()



IDX_neg = labels <= 0
differror = np.square(labels - pmap)
differror[~IDX_neg] = 0
neg_score = differror.sum() / max(1, (pmap[IDX_neg] >0 ).sum())

IDXa = np.where(pmap > 0)


return [pos_score, neg_score]



else:
EPS = np.finfo(float).eps

Expand Down
7 changes: 0 additions & 7 deletions Demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@
dir3 = './Results/TrainOnRandomSelection_w45_fault/Pmap_exist_quest.npz'
dir4 = './Results/TrainOnRandomSelection_w45_fault/PMAP_exist.npz'



dir5 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Australia.hdf5Australia_strip.mat.npz'
dir6 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Australia.hdf5QUEST_strip.mat.npz'
dir7 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Mixed.hdf5Australia_strip.mat.npz'
dir8 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Mixed.hdf5QUEST_strip.mat.npz'
dir9 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Quest.hdf5Australia_strip.mat.npz'
dir10 = './Results/NewTrainingRandom_strip_mixed/Pmamp_Fault_Quest.hdf5QUEST_strip.mat.npz'


dir11 = './Results/First3Layers/Pmamp_Fault_Australia.hdf5Australia_strip.mat.npz'



jdir = './applet.json'
# Load and run application:
p = PmapViewer(dir=jdir)
p.run()



#TODO: Prepare a demo video on training phase
5 changes: 1 addition & 4 deletions LogParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
model_quest = {}
model_mixed = {}


models = [model_australia, model_quest, model_mixed]

for m in models:
m['Quest'] = {}
m['Australia'] = {}
Expand All @@ -21,9 +21,6 @@
m[mp]['All_n'] = []





with open("log.txt", "r") as f:
for it in range(72):

Expand Down
Loading