-
-
Notifications
You must be signed in to change notification settings - Fork 65
Profiling vignette #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Profiling vignette #435
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9786b99
template for profiling vignette
jgabry 84c3805
Merge branch 'profiling' into profiling-vignette
rok-cesnovar 449b5b9
Merge branch 'profiling' into profiling-vignette
rok-cesnovar ed78409
basic info
rok-cesnovar f0fda31
Merge branch 'master' into profiling-vignette
rok-cesnovar f7b8f5d
add more details in profiling vignette
rok-cesnovar 4879bb4
Updated profiling vignette
bbbales2 7b59ce1
use 2.26 rc in tests
rok-cesnovar e1d2ab5
add models to vignette
rok-cesnovar 1459505
add reference to profiling vignette
rok-cesnovar ecb0200
temporary fix for test
rok-cesnovar 99528bf
add reference to profiling vignette
rok-cesnovar 4cc51af
dont run install test that relies on latest release not being RC
rok-cesnovar d9a3b6e
a different fix
rok-cesnovar f06c7a9
Merge branch 'profiling-vignette' of https://github.com/stan-dev/cmds…
jgabry bd2bd1a
minor edits
jgabry e906bc1
remove executables
jgabry ec90eee
gitignore executables
jgabry c0afe23
Update NEWS.md
jgabry 369a3eb
temporary fix for RC tests
rok-cesnovar 92753e3
rebuild html after edits
rok-cesnovar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
docs/articles/profiling_files/accessible-code-block-0.0.1/empty-anchor.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> | ||
// v0.0.1 | ||
// Written by JooYoung Seo ([email protected]) and Atsushi Yasumoto on June 1st, 2020. | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
const codeList = document.getElementsByClassName("sourceCode"); | ||
for (var i = 0; i < codeList.length; i++) { | ||
var linkList = codeList[i].getElementsByTagName('a'); | ||
for (var j = 0; j < linkList.length; j++) { | ||
if (linkList[j].innerHTML === "") { | ||
linkList[j].setAttribute('aria-hidden', 'true'); | ||
} | ||
} | ||
} | ||
}); |
4 changes: 4 additions & 0 deletions
4
docs/articles/profiling_files/anchor-sections-1.0/anchor-sections.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Styles for section anchors */ | ||
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} | ||
a.anchor-section::before {content: '#';} | ||
.hasAnchor:hover a.anchor-section {visibility: visible;} |
33 changes: 33 additions & 0 deletions
33
docs/articles/profiling_files/anchor-sections-1.0/anchor-sections.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. | ||
document.addEventListener('DOMContentLoaded', function() { | ||
// Do nothing if AnchorJS is used | ||
if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { | ||
return; | ||
} | ||
|
||
const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); | ||
|
||
// Do nothing if sections are already anchored | ||
if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { | ||
return null; | ||
} | ||
|
||
// Use section id when pandoc runs with --section-divs | ||
const section_id = function(x) { | ||
return ((x.classList.contains('section') || (x.tagName === 'SECTION')) | ||
? x.id : ''); | ||
}; | ||
|
||
// Add anchors | ||
h.forEach(function(x) { | ||
const id = x.id || section_id(x.parentElement); | ||
if (id === '') { | ||
return null; | ||
} | ||
let anchor = document.createElement('a'); | ||
anchor.href = '#' + id; | ||
anchor.classList = ['anchor-section']; | ||
x.classList.add('hasAnchor'); | ||
x.appendChild(anchor); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
docs/articles/profiling_files/header-attrs-2.3/header-attrs.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to | ||
// be compatible with the behavior of Pandoc < 2.8). | ||
document.addEventListener('DOMContentLoaded', function(e) { | ||
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); | ||
var i, h, a; | ||
for (i = 0; i < hs.length; i++) { | ||
h = hs[i]; | ||
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 | ||
a = h.attributes; | ||
while (a.length > 0) h.removeAttribute(a[0].name); | ||
} | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.html | ||
*.R | ||
profiling-files/profiling_bernoulli_logit_glm | ||
profiling-files/profiling_bernoulli_logit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@misc{gelman2020bayesian, | ||
title={Bayesian Workflow}, | ||
author={Andrew Gelman and Aki Vehtari and Daniel Simpson and Charles C. Margossian and Bob Carpenter and Yuling Yao and Lauren Kennedy and Jonah Gabry and Paul-Christian Bürkner and Martin Modrák}, | ||
year={2020}, | ||
eprint={2011.01808}, | ||
archivePrefix={arXiv}, | ||
primaryClass={stat.ME} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
data { | ||
int<lower=1> k; | ||
int<lower=0> n; | ||
matrix[n, k] X; | ||
int y[n]; | ||
} | ||
parameters { | ||
vector[k] beta; | ||
real alpha; | ||
} | ||
model { | ||
profile("priors") { | ||
target += std_normal_lpdf(beta); | ||
target += std_normal_lpdf(alpha); | ||
} | ||
profile("likelihood") { | ||
target += bernoulli_logit_lpmf(y | X * beta + alpha); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
vignettes/profiling-files/profiling_bernoulli_logit_glm.stan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
data { | ||
int<lower=1> k; | ||
int<lower=0> n; | ||
matrix[n, k] X; | ||
int y[n]; | ||
} | ||
parameters { | ||
vector[k] beta; | ||
real alpha; | ||
} | ||
model { | ||
profile("priors") { | ||
target += std_normal_lpdf(beta); | ||
target += std_normal_lpdf(alpha); | ||
} | ||
profile("likelihood") { | ||
target += bernoulli_logit_glm_lpmf(y | X, alpha, beta); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating a new vignette you need to add the file name (without the .Rmd) to the articles section of _pkgdown.yml