- np.random.rand(), np.random.randn()
@
- np.random.rand(), np.random.randn()
np.random.rand() draws niform distribution
np.random.randn() draws normal distribution
Normal distribution works better in deep learning,
because it's more suited for cross validated
@
*
A_method() in A_class can be used in other class
class Dialog():
def load_vocabulary(self,vocabulary_path):
class ChatBot:
def __init__(self,voc_path,train_dir):
self.dialog=Dialog()
self.dialog.load_vocabulary(vocabulary_path)
*
member_variable in A_class can be used in other class
class Dialog():
def __init__(self):
self.vocabulary_size=0
class ChatBot:
def __init__(self,vocabulary_path,checkpoint_dir_for_train):
self.dialog=Dialog()
self.model=Seq2Seq(self.dialog.vocabulary_size)
@
You can't import pythonfile.py,
if that file has error.
And kind of error can be useless spaces
class Seq2Seq:
logits=None
def _build_cells(self,dropout=0.5):
enc_cell_list\
=tf.nn.rnn_cell.MultiRNNCell(\
[self._cell(dropout) for _ in range(self.number_of_layers)])
Due to above error, you can't import model.py file
from model import Seq2Seq