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 — change the way of getting vocsize, nclasses. · mpage/DeepLearningTutorials@e4cad43

File tree

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

‎code/rnnslu.py‎

Copy file name to clipboardExpand all lines: code/rnnslu.py
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,8 @@ def main(param=None):
288288
valid_lex, valid_ne, valid_y = valid_set
289289
test_lex, test_ne, test_y = test_set
290290

291-
vocsize = len(set(reduce(lambda x, y: list(x) + list(y),
292-
train_lex + valid_lex + test_lex)))
293-
nclasses = len(set(reduce(lambda x, y: list(x)+list(y),
294-
train_y + test_y + valid_y)))
291+
vocsize = len(dic['words2idx'])
292+
nclasses = len(dic['labels2idx'])
295293
nsentences = len(train_lex)
296294

297295
groundtruth_valid = [map(lambda x: idx2label[x], y) for y in valid_y]

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.