Skip to content

Commit

Permalink
update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Aug 22, 2023
1 parent f07a93c commit b390976
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
10 changes: 4 additions & 6 deletions src/oneat/NEATModels/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(
key_categories=None,
key_cord=None,
stage_number=3,
last_conv_factor=4,
imagex=128,
imagey=128,
size_tminus=3,
Expand Down Expand Up @@ -60,15 +59,15 @@ def __init__(
self.startfilter = startfilter
self.lstm_hidden_unit = lstm_hidden_unit
self.epochs = epochs
self.stride = last_conv_factor
self.stride = 2**(stage_number -1)
self.learning_rate = learning_rate
self.batch_size = batch_size
self.model_name = model_name
self.show = show
self.imagex = imagex
self.imagey = imagey
self.stage_number = stage_number
self.last_conv_factor = last_conv_factor
self.last_conv_factor = 2**(stage_number -1)
self.size_tminus = size_tminus
self.size_tplus = size_tplus
self.pure_lstm = pure_lstm
Expand Down Expand Up @@ -179,7 +178,6 @@ def __init__(
key_categories=None,
key_cord=None,
stage_number=3,
last_conv_factor=4,
imagex=64,
imagey=64,
imagez=4,
Expand Down Expand Up @@ -223,7 +221,7 @@ def __init__(
self.mid_kernel = mid_kernel
self.startfilter = startfilter
self.epochs = epochs
self.stride = last_conv_factor
self.stride = 2**(stage_number-1)
self.learning_rate = learning_rate
self.batch_size = batch_size
self.model_name = model_name
Expand All @@ -232,7 +230,7 @@ def __init__(
self.imagey = imagey
self.imagez = imagez
self.stage_number = stage_number
self.last_conv_factor = last_conv_factor
self.last_conv_factor = 2**(stage_number-1)
self.size_tminus = size_tminus
self.size_tplus = size_tplus
self.pure_lstm = pure_lstm
Expand Down
20 changes: 7 additions & 13 deletions src/oneat/NEATUtils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,15 @@ def create_sub_image(image, n, m, p, stride):
for t_idx in range(t):
sub_image_t = image[t_idx]

z_remainder = z % n
y_remainder = y % m
x_remainder = x % p
new_z = z + (n - z % n) % n
new_y = y + (m - y % m) % m
new_x = x + (p - x % p) % p

new_z = z - z_remainder + (n - 1)
new_y = y - y_remainder + (m - 1)
new_x = x - x_remainder + (p - 1)
pad_z = (new_z - z)
pad_y = (new_y - y)
pad_x = (new_x - x)

sub_image = sub_image_t[:new_z, :new_y, :new_x]

pad_z = (new_z - z) % stride
pad_y = (new_y - y) % stride
pad_x = (new_x - x) % stride

sub_image_padded = np.pad(sub_image, ((0, pad_z), (0, pad_y), (0, pad_x)), mode='constant')
sub_image_padded = np.pad(sub_image_t, ((0, pad_z), (0, pad_y), (0, pad_x)), mode='constant')

sub_images.append(sub_image_padded)

Expand Down

0 comments on commit b390976

Please sign in to comment.