probmods / chapters Goto Github PK
View Code? Open in Web Editor NEWThe online textbook Probabilistic Models of Cognition
Home Page: https://probmods.org
The online textbook Probabilistic Models of Cognition
Home Page: https://probmods.org
Not sure if this is an issue really, but when multiple histograms are used, e.g.:
(hist (repeat 2000 (lambda () (chain 'a 2))) "a 2")
(hist (repeat 2000 (lambda () (chain 'c 2))) "c 2")
(hist (repeat 2000 (lambda () (chain 'a 10))) "a 10")
(hist (repeat 2000 (lambda () (chain 'c 10))) "c 10")
Only the last one is displayed. If "'done" is added to the end, no histogram at all is displayed. This makes for unclear comparisons and should perhaps be made into subplots all displayed at once.
exact-query returns error:
Running the following:
"(exact-query
(define A 1)
A
(equals 2 2)
)"
returns:
_A is not defined
In the joint lung-cancer / TB inference example on the conditioning page, the resulting histogram is humongous - each bar takes up way too much space. NB: this example takes a while to run.
In content, some references are still in Mediawiki format
Trying to use 'truehist' returns:
_truehist is not defined
It would be useful to be able to delete things from the play-space to avoid clutter, and also to load multiple files into one another to again, avoid clutter.
Citations cause an error for most recent pandoc (1.12.1).
Pressing tab in codebox should re-indent the current line (or current region when selected), not be a tab character.
Running the example 'states with structure and Gibbs sampling' in chapter 6 (https://www.probmods.org/inference-process.html) returns the error:
_drop_45right is not defined
Also this comes out completely crazy in the version of webchurch that chapters is using. The craziness is fixed in the most up-to-date webchurch.
Here's the code examples that's wrong (In "Patterns of Inference")
(define observed-luminance 3.0)
(define samples
(mh-query
1000 10
(define reflectance (gaussian 1 1))
(define illumination (gaussian 3 0.5))
(define luminance (* reflectance illumination))
reflectance
(condition (= luminance (gaussian observed-luminance 0.1)))
(condition (= illumination (gaussian 0.5 0.1)))))
(multiviz "Mean reflectance: " (mean samples)
(hist samples "Reflectance"))
If you replace the two conditions with an and statement it takes a reallllly long time to run, but I think it would do the correct thing.
Running the third code block in the ninth chapter (https://www.probmods.org/hierarchical-models.html) returns the following error:
sample_gamma is not defined
Bars are too big.
Have a flag to or variant of mh-query and rejection-query that makes a histogram of samples and updates it on each sample. This can be done by extending probabilistic-js inference routines to take a listener function (which is called when a sample is taken), and then creating a listener that calls the _hist vizualization tool.
conditional probabilities should be formatted as P(x \mid y), not P(x|y)
Also, think about using something like Less / Sass.
In the "markov chains with lag" example, in chapter 6 here:
https://www.probmods.org/inference-process.html
The following use of "drop":
(hist (drop (chain 'a 100) 30) "burn-in 30, lag 0")
returns the error:
_drop is not defined
Separate the content .md files from the scripts and resources.
The scripts repo should have a build script that takes a folder location as input, builds all .md files in that directory, optionally builds an index if there is a chapters.txt file, and puts the generated html and all runtime scripts into a new subdirectory. (Runtime scripts might be just one merged and minified js with all the scripts?)
Ultimately we should move the chapter md files to a separate repository, but for now can just move them to a subdirectory.
Is it possible to batch DOM updates?
Preliminary attempts at this have a weird quirk where CodeMirror content isn't actually visible until mousedown on codebox.
trying to use "take" returns:
_take is not defined
(take is used in some examples on the website)
Add machinery for simple quizzes (with, e.g., multiple choice answers). Should play nice with accounts so that when students are logged in their quiz results will be logged (and retrievable by admin based on email address). These will be use to make "comprehension tests" for the chapters.
trying to run the fourth code-block in the seventh chapter ( https://www.probmods.org/learning-as-conditional-inference.html) returns the error:
Object # has no method 'wrapped_beta'
It would be useful to have code folding possible in the codemirror boxes, and have a way in the markdown to tell a region to start out folded. This way helper routines could be hidden from sight. Eg:
(define coolfun ...)
;;;folded helper code
(define boringfun ...)
;;;
..the real stuff..
Why? There are lots of examples that build progressively meaning we repeat the same code... It would look much better to hide this code from sight after the first time.
Would be useful to have, inter alia:
In codemirror church style, it would be nice to:
-have a different syntax coloring for erps.
-color queries specially: special color for the query (and matching bracket?), special color for query expression and condition expression.
Switch to make for building project. (Fairly low priority, as everything works right now, but should be done at some point.)
Build html files into a subdirectory.
Rather than a "delete" button, we should have a little X in upper right hand corner on mouseover to delete a viz plot.
For example, running this:
(query
(define x 3)
x
(> x 2))
returns this:
_x is not defined
Could use Google Closure compiler to collect all/many JS dependencies in one file.
Currently histograms and such pile up as we run a code box. Want to replace instead of adding.
Trying to run the second (and last) code block in chapter 8 (https://www.probmods.org/grammar-based-induction-LoT.html) returns the error:
_make_45beta_45binomial is not defined
To be more specific, I think the y-axis labels are flipped. Here is a little bit of code that exhibits the problem.
(define samps
(mh-query
500 2
(define x (multinomial '(.1 .3 .5 .7) '(1 3 5 7)))
(define y (+ x (gaussian 0 0.001)))
y
true
)
)
(hist samps)
Add analytics hooks so that we can track site usage.
(Use google analytics?)
Trying to run the first code block in chapter 8 (https://www.probmods.org/grammar-based-induction-LoT.html) returns:
_list_45ref is not defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.