Skip to content

Commit

Permalink
open source
Browse files Browse the repository at this point in the history
  • Loading branch information
hyhieu committed Apr 2, 2018
1 parent 140286d commit 014bae1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
outputs*
outputs/*

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion scripts/cifar10_macro_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ python src/cifar10/main.py \
--num_epochs=310 \
--log_every=50 \
--eval_every_epochs=1 \
--child_fixed_arc="$fixed_arc" \
--child_fixed_arc="${fixed_arc}" \
--child_use_aux_heads \
--child_num_layers=24 \
--child_out_filters=96 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/cifar10_micro_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ python src/cifar10/main.py \
--num_epochs=630 \
--log_every=50 \
--eval_every_epochs=1 \
--child_fixed_arc="$fixed_arc" \
--child_fixed_arc="${fixed_arc}" \
--child_use_aux_heads \
--child_num_layers=15 \
--child_out_filters=36 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/ptb_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python src/ptb/main.py \
--batch_size=64 \
--child_bptt_steps=35 \
--num_epochs=2000 \
--child_fixed_arc="$fixed_arc" \
--child_fixed_arc="${fixed_arc}" \
--child_rhn_depth=12 \
--child_num_layers=1 \
--child_lstm_hidden_size=748 \
Expand Down
3 changes: 1 addition & 2 deletions src/cifar10/general_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def _fixed_layer(
return out

def _conv_branch(self, inputs, filter_size, is_training, count, out_filters,
start_idx=None, separable=False):
ch_mul=1, start_idx=None, separable=False):
"""
Args:
start_idx: where to start taking the output channels. if None, assuming
Expand Down Expand Up @@ -518,7 +518,6 @@ def _conv_branch(self, inputs, filter_size, is_training, count, out_filters,
x = batch_norm(x, is_training, data_format=self.data_format)
else:
if separable:
ch_mul = 1
w_depth = create_weight("w_depth", [filter_size, filter_size, out_filters, ch_mul])
w_point = create_weight("w_point", [out_filters, out_filters * ch_mul])
w_point = w_point[start_idx:start_idx+count, :]
Expand Down
12 changes: 8 additions & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import sys
import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -31,7 +35,7 @@ def DEFINE_boolean(name, default_value, doc_string):


def print_user_flags(line_limit=80):
print "-" * 80
print("-" * 80)

global user_flags
FLAGS = tf.app.flags.FLAGS
Expand All @@ -41,7 +45,7 @@ def print_user_flags(line_limit=80):
log_string = flag_name
log_string += "." * (line_limit - len(flag_name) - len(value))
log_string += value
print log_string
print(log_string)


class TextColors:
Expand Down Expand Up @@ -197,10 +201,10 @@ def _no_update():
# else:
# g_n = tf.reduce_sum(g ** 2)
# if "enas_cell" in v.name:
# print "g_1: {}".format(v.name)
# print("g_1: {}".format(v.name))
# g_1 += g_n
# else:
# print "g_2: {}".format(v.name)
# print("g_2: {}".format(v.name))
# g_2 += g_n
# learning_rate = tf.Print(learning_rate, [g_1, g_2, tf.sqrt(g_1 / g_2)],
# message="g_1, g_2, g_1/g_2: ", summarize=5)
Expand Down

0 comments on commit 014bae1

Please sign in to comment.