GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a parameter to make the test set smaller · jayakumark/DeepLearningTutorials@26914e4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • code
    • lstm.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/lstm.py‎

Copy file name to clipboardExpand all lines: code/lstm.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ def train_lstm(
395395
use_dropout=True, # if False slightly faster, but worst test error
396396
# This frequently need a bigger model.
397397
reload_model="", # Path to a saved model we want to start from.
398+
test_size=-1, # If >0, we will trunc the test set to this number of example.
398399
):
399400

400401
# Model options
@@ -406,6 +407,8 @@ def train_lstm(
406407
print 'Loading data'
407408
train, valid, test = load_data(n_words=n_words, valid_portion=0.05,
408409
maxlen=maxlen)
410+
if test_size > 0:
411+
test = (test[0][:test_size], test[1][:test_size])
409412

410413
ydim = numpy.max(train[1]) + 1
411414

@@ -578,4 +581,5 @@ def train_lstm(
578581
train_lstm(
579582
#reload_model="lstm_model.npz",
580583
max_epochs=100,
584+
test_size=500,
581585
)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.