Skip to content

Commit

Permalink
fixing the missing hkl import, preprocessing (#22)
Browse files Browse the repository at this point in the history
in models: alexnet, googlenet, resnet50, vgg16
  • Loading branch information
hma02 committed Jul 20, 2017
1 parent 79e97dd commit 7dca17b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 8 deletions.
22 changes: 20 additions & 2 deletions theanompi/models/alex_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,16 @@ def train_iter(self, count,recorder):

else:

arr = hkl.load(img[self.current_t]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_t]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

self.shared_x.set_value(arr)

Expand Down Expand Up @@ -510,7 +519,16 @@ def val_iter(self, count,recorder):
else:


arr = hkl.load(img[self.current_v]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_v]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

# arr = np.rollaxis(arr,0,4)

Expand Down
22 changes: 20 additions & 2 deletions theanompi/models/googlenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,16 @@ def train_iter(self, count, recorder):

else:

arr = hkl.load(img[self.current_t]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_t]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

self.shared_x.set_value(arr)

Expand Down Expand Up @@ -857,7 +866,16 @@ def val_iter(self, count,recorder):
else:


arr = hkl.load(img[self.current_v]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_v]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

# arr = np.rollaxis(arr,0,4)

Expand Down
23 changes: 21 additions & 2 deletions theanompi/models/lasagne_model_zoo/resnet50.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,16 @@ def train_iter(self, count,recorder):

else:

arr = hkl.load(img[self.current_t]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_t]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

self.shared_x.set_value(arr)

Expand Down Expand Up @@ -580,7 +589,17 @@ def val_iter(self, count,recorder):
else:


arr = hkl.load(img[self.current_v]) #- img_mean
img_mean = self.data.rawdata[-1]

import hickle as hkl
arr = hkl.load(img[self.current_v]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

# arr = np.rollaxis(arr,0,4)

Expand Down
22 changes: 20 additions & 2 deletions theanompi/models/lasagne_model_zoo/vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,16 @@ def train_iter(self, count,recorder):

else:

arr = hkl.load(img[self.current_t]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_t]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

self.shared_x.set_value(arr)

Expand Down Expand Up @@ -484,7 +493,16 @@ def val_iter(self, count,recorder):
else:


arr = hkl.load(img[self.current_v]) #- img_mean
img_mean = self.data.rawdata[-1]
import hickle as hkl
arr = hkl.load(img[self.current_v]) - img_mean

from theanompi.models.data.utils import crop_and_mirror

arr = crop_and_mirror(arr, mode,
rand_crop,
batch_crop_mirror,
input_width)

# arr = np.rollaxis(arr,0,4)

Expand Down

0 comments on commit 7dca17b

Please sign in to comment.