Skip to content

Commit

Permalink
Typos, style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwinpin committed Aug 17, 2018
1 parent 6dbb0d7 commit e07c129
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
16 changes: 8 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

def main():
(x_train, y_train), (x_test, y_test) = imdb.load_data(
path="imdb.npz",
num_words=30000,
skip_top=0,
maxlen=100,
seed=113,
start_char=1,
oov_char=2,
index_from=3)
path="imdb.npz",
num_words=30000,
skip_top=0,
maxlen=100,
seed=113,
start_char=1,
oov_char=2,
index_from=3)

evaluator = neuvol.Evaluator(x_train, y_train, kfold_number=1)
mutator = neuvol.Mutator()
Expand Down
1 change: 1 addition & 0 deletions neuvol/architecture/individ_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from copy import deepcopy

from keras.layers import concatenate
from keras.models import Model
from keras.optimizers import adam, RMSprop
Expand Down
6 changes: 3 additions & 3 deletions neuvol/crossing/pairing_modules/pairing_modules_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def peform_pairing(individ, father, mother, pairing_type):

elif pairing_type == 'father_data_processing':
return father_data_processing_pairing(individ, father, mother)

elif pairing_type == 'father_architecture_slice_mother':
return father_architecture_slice_mother(individ, father, mother, limitations)

Expand Down Expand Up @@ -92,7 +92,7 @@ def father_architecture_parameter_pairing(individ, father, mother, limitations):
individ.architecture = father.architecture
individ.training_parameters = father.training_parameters
individ.data_processing = father.data_processing

else:
intersected_block = np.random.choice(list(intersections))

Expand Down Expand Up @@ -145,7 +145,7 @@ def father_architecture_slice_mother(individ, father, mother, limitations):
mother_cut_point = np.random.choice([i for i in range(limitations[0], len(mother.architecture) - limitations[1])])

tmp_individ = father.architecture[:father_cut_point] + mother.architecture[mother_cut_point:]

individ.architecture = tmp_individ
individ.data_processing = father.data_processing
individ.training_parameters = father.training_parameters
Expand Down
6 changes: 6 additions & 0 deletions neuvol/evolution/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ def population(self, n=5):
print('\n\n')

def population_raw_individ(self):
"""
Get the whole population itself
"""
return self._population

@property
def stages(self):
"""
Number of stages
"""
return self._stages

@stages.setter
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
2 changes: 1 addition & 1 deletion tests/test_architecture_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_architecture_initialization_error(self):
with self.assertRaises(KeyError):
cradle(0)

@unittest.expectedFailure
@unittest.skip('Unstable test')
def test_architecture_tf_building(self):
self.assertEqual(3, len(self.individ.init_tf_graph()))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_architecture_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_architecture_initialization_error(self):
with self.assertRaises(KeyError):
cradle(0)

@unittest.expectedFailure
@unittest.skip('Unstable test')
def test_architecture_tf_building(self):
self.assertEqual(3, len(self.individ.init_tf_graph()))

Expand Down

0 comments on commit e07c129

Please sign in to comment.