Description Usage Arguments Value Methods (by class) Author(s) Examples
Computes model class conditional probabilities
1 2 3 4 5 6 |
object |
Linear classifier specification object. |
feats |
Numeric Matrix of features. Follows the usual convention of having one example per row. For a model with M features and dataset with N examples the matrix should be N \times K |
normalize |
Logical scalar. If TRUE return normalized probabilities |
log_domain |
Logical scalar. If TRUE returns log probabilities. |
backend |
Computation back-end ('R', 'C', or 'CUDA') |
... |
other arguments passed to specific methods |
Numeric Matrix. Class conditional probabilities matrix. Each row corresponds to the probabilities of one example. For model with K classes and a dataset of N examples the returned matrix should be N \times K
model.spec
: Computes model class conditional probabilities for
linear classifier specification objects
Mohamed Ishmael Diwan Belghazi
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Generate random initial weights
w_init <- matrix(rnorm(784 * 10), 784, 10)
# construct model
linear_classifier <- Classifier(weights_init=w_init)
# Fetch training variables
feats <- mini_mnist$train$images
targets <- mini_mnist$train$labels
# Set decay coefficient
decay <- 0.01
# compute log probabilities of the training set using the three back-ends
log_prob_R <- get_prob(linear_classifier, feats, TRUE, TRUE, 'R')
log_prob_C <- get_prob(linear_classifier, feats, TRUE, TRUE, 'C')
log_prob_CUDA <- get_prob(linear_classifier, feats, TRUE, TRUE, 'CUDA')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.