[jayRnn]
- adjusted params
This commit is contained in:
@@ -27,7 +27,7 @@ from rbm.status import Status
|
||||
TEXT = "Call me Ishmael. Some years ago" # the character sequence to learn (matches diagram example)
|
||||
WIN = 2 # sliding-window width (= N in the diagram)
|
||||
STRIDE = 1 # sliding-window step size
|
||||
UNITS = 3
|
||||
UNITS = 5
|
||||
H_SIZE = 128 # hidden units per RBM cell
|
||||
NUM_EPOCHS = 1000
|
||||
NUM_ITERATIONS = 1
|
||||
@@ -36,7 +36,7 @@ TRAIN_PARAMS = TrainingParams(
|
||||
learning_rate = 0.1,
|
||||
momentum = 0.5,
|
||||
num_epochs = NUM_EPOCHS,
|
||||
do_rao_blackwell = True,
|
||||
do_rao_blackwell = False,
|
||||
num_gibbs_samples= 1
|
||||
)
|
||||
#WIN=3
|
||||
@@ -56,8 +56,8 @@ def str2vec(ch_str: str) -> Mat:
|
||||
def to_window(text: str) -> list[str]:
|
||||
result = []
|
||||
_win = [' ']*UNITS
|
||||
for _i in range(WIN - 1):
|
||||
for ch in text:
|
||||
for _i in range(WIN-1):
|
||||
_win = _win[1:WIN] + [ch]
|
||||
result += _win
|
||||
|
||||
|
||||
Reference in New Issue
Block a user