Skip to content

Commit

Permalink
Fixed CRAN suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Baker committed May 1, 2019
1 parent d664bc3 commit c2c1771
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 7 deletions.
8 changes: 7 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
## Previous Submissions

> Found the following (possibly) invalid URLs: https://www.kaggle.com/wiki/LogLoss
Fixed

## Test environments
System requirements fully met:
* Ubuntu 14.04 (on travis-ci), R release and R-devel
* Windows Server 2016 (Microsoft Azure Virtual Machine), R 3.4.1

TensorFlow package not properly installed with `tensorflow::install_tensorflow()`:
TensorFlow package not properly installed with `sgmcmc::installTF()`:
* win-builder (devel)

## R CMD check restults
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/logisticRegression.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/nn.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/logisticRegression.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ output = sgldcv(logLik, dataset, params, stepsizesMCMC, stepsizesOptimization, l
})
```

A common performance measure for a classifier is the [log loss](https://www.kaggle.com/wiki/LogLoss). To check the algorithm converged, we'll plot the log loss of the data from our test set every 10 iterations. Let $$\hat \pi_i^{(j)} := \frac{1}{1 + \exp\left[-\beta_0^{(j)} - \mathbf x_i \beta^{(j)}\right]},$$
A common performance measure for a classifier is the [log loss](https://datawookie.netlify.com/blog/2015/12/making-sense-of-logarithmic-loss/). To check the algorithm converged, we'll plot the log loss of the data from our test set every 10 iterations. Let $$\hat \pi_i^{(j)} := \frac{1}{1 + \exp\left[-\beta_0^{(j)} - \mathbf x_i \beta^{(j)}\right]},$$
here $\hat \pi_i^{(j)}$ denotes the probability that the $j^{\text{th}}$ iteration of our MCMC chain assigned to observation $i$ is in our test set. Define our test set by $T$, the log loss is given by
$$A := \frac{1}{|T|} \sum_{y_i \in T} \left[ y_i \log \hat \pi_i^{(j)} + (1 - y_i) \log(1 - \hat \pi_i^{(j)}) \right]$$

Expand Down
2 changes: 1 addition & 1 deletion vignettes/nn.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Here the function `sgmcmcStep` will update `sgld$params` using a single update o

Our simple example is fine, but we really would like to calculate a Monte Carlo average of the parameters on the fly. Also with these large examples, they take a long time to run, so it's useful to check how the algorithm is doing every once in a while. This is especially useful when tuning by trial and error as you can stop an algorithm early if it's doing badly. This is why we let you declare the TensorFlow session yourself: it lets you create your custom tensors to print algorithm progress, or to create your own test functions to reduce the chain dimensionality (they have to be declared before the TensorFlow session starts).

Let's delete everything after we created our `sgld` object. Now we're going to demonstrate a more complicated step by step example where we print performance and calulate the Monte Carlo estimate on the fly. Suppose we have test data $X^*$, and test labels $y^*$, and at some iteration $i$ our SGMCMC algorithm outputs values for all the parameters $\theta_t$. Then the probability that our neural network model will classify a given test observation to class $k$ is given by $\beta_k(\theta_t, \mathbf x_i^*)$; i.e. the $k^{th}$ element of $\beta(\theta_t, \mathbf x_i^*)$, which was defined earlier. A common performance measure for a classifier is the [log loss](https://www.kaggle.com/wiki/LogLoss), defined by
Let's delete everything after we created our `sgld` object. Now we're going to demonstrate a more complicated step by step example where we print performance and calulate the Monte Carlo estimate on the fly. Suppose we have test data $X^*$, and test labels $y^*$, and at some iteration $i$ our SGMCMC algorithm outputs values for all the parameters $\theta_t$. Then the probability that our neural network model will classify a given test observation to class $k$ is given by $\beta_k(\theta_t, \mathbf x_i^*)$; i.e. the $k^{th}$ element of $\beta(\theta_t, \mathbf x_i^*)$, which was defined earlier. A common performance measure for a classifier is the [log loss](https://datawookie.netlify.com/blog/2015/12/making-sense-of-logarithmic-loss/), defined by
$$
ll = - \frac{1}{N} \sum_{i=1}^{N_{\text{test}}} \sum_{k=1}^K y^*_{i,k} \log \beta( \theta_t, \mathbf x_i^* ).
$$
Expand Down

0 comments on commit c2c1771

Please sign in to comment.