karpathy / karpathy/convnetjs

how to reference Brain()?

Open
#79 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.2k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

I feel it's a really stupid node question to ask, but really can't figure it out after a few hours. So here is the code that embarrasses me:
>
var convnetjs = require("convnetjs");
var net = new convnetjs.Net();
var brain = new convnetjs.deepqlearn.Brain(3, 2);

Basically it couldn't find Brain function:

>
weiwe-macbookpro:test weiwe$ node index.js
/Users/weiwe/test/index.js:5
var brain = new convnetjs.deepqlearn.Brain(3, 2);
^

>
TypeError: Cannot read property 'Brain' of undefined
at Object. (/Users/weiwe/test/index.js:5:37)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

I'm pretty sure the NPM module is installed correctly because I can use functions (e.g., Net()) in convnet.js just fine. Scratching my head on why this doesn't work .....

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.