Skip to content

Conversation

@Superjomn
Copy link
Contributor

No description provided.

@Superjomn Superjomn requested review from jacquesqiao, lcy-seso and pkuyym and removed request for jacquesqiao and pkuyym January 30, 2018 03:32
import __init__ as pd


class SequenceDecoder:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it's more appropriate to move the class to control_flow.py or net.py


class SequenceDecoder:
class Cell:
modes = ('train', 'decode')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make modes be a enum variable.

class SequenceDecoder:
class Cell:
modes = ('train', 'decode')
kinds = ('step_input', 'state', 'other_shared')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cell_types is a better name.

}
}

def __init__(self, kind, id, init_var, dtype='float32'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that id is a str variable, I think name is better.

class Cell:
modes = ('train', 'decode')
kinds = ('step_input', 'state', 'other_shared')
dic = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dic is not a good name, maybe holder?

if self.mode == 'train':
self.rnn = seqdec.train_rnn

def create(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems create is not appropriate, consider to use a better name like switch_mode etc.

return item
return pd.array_read(array=item, i=counter)

def _create_train(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_create_train --> _switch_to_train_mode

self.updater()

@staticmethod
def get(mode, kind, id, counter=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get --> get_item ?

pd.array_write(selected_ids, array=ids_array, i=self.counter)
pd.array_write(selected_scores, array=scores_array, i=self.counter)

for no, state in enumerate(self.states):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no --> state_idx

'''
with self.train_rnn.block():
# create item_id
self.item_id.set_mode('train')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item_id is a str variable ? If so, please change a name.

@Superjomn Superjomn closed this May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants