Skip to content

Commit

Permalink
Unify the structure of testing data
Browse files Browse the repository at this point in the history
  • Loading branch information
wulingyun committed Feb 11, 2014
1 parent 6ead2e4 commit 9d72a3e
Show file tree
Hide file tree
Showing 59 changed files with 4,607 additions and 2,463 deletions.
11 changes: 7 additions & 4 deletions .hgignore
@@ -1,4 +1,7 @@
glob:src-i386/*
glob:src-x64/*
glob:*.bak
glob:.svn/*
syntax: glob
src-i386/*
src-x64/*
.svn/*
*.bak
*.so
*.o
6 changes: 3 additions & 3 deletions R/CRF-package.R
Expand Up @@ -76,9 +76,9 @@
#'
#' library(CRF)
#' data(Small)
#' decode.exact(small.crf)
#' infer.exact(small.crf)
#' sample.exact(small.crf, 100)
#' decode.exact(Small$crf)
#' infer.exact(Small$crf)
#' sample.exact(Small$crf, 100)
#'
#' @useDynLib CRF, .registration = TRUE
#'
Expand Down
6 changes: 3 additions & 3 deletions R/clamp.R
Expand Up @@ -22,7 +22,7 @@
#'
#' library(CRF)
#' data(Small)
#' crf <- clamp.crf(small.crf, c(0, 0, 1, 1))
#' crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))
#'
#'
#' @export
Expand Down Expand Up @@ -80,7 +80,7 @@ clamp.crf <- function(crf, clamped)
#'
#' library(CRF)
#' data(Small)
#' crf <- clamp.crf(small.crf, c(0, 0, 1, 1))
#' crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))
#' clamp.reset(crf, c(0,0,2,2))
#'
#'
Expand Down Expand Up @@ -123,7 +123,7 @@ clamp.reset <- function(crf, clamped)
#'
#' library(CRF)
#' data(Small)
#' crf <- sub.crf(small.crf, c(2, 3))
#' crf <- sub.crf(Small$crf, c(2, 3))
#'
#'
#' @export
Expand Down
28 changes: 14 additions & 14 deletions R/decode.R
Expand Up @@ -10,7 +10,7 @@
#'
#' library(CRF)
#' data(Small)
#' d <- decode.exact(small.crf)
#' d <- decode.exact(Small$crf)
#'
#' @export
decode.exact <- function(crf)
Expand All @@ -30,7 +30,7 @@ decode.exact <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.chain(small.crf)
#' d <- decode.chain(Small$crf)
#'
#' @export
decode.chain <- function(crf)
Expand All @@ -50,7 +50,7 @@ decode.chain <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.tree(small.crf)
#' d <- decode.tree(Small$crf)
#'
#' @export
decode.tree <- function(crf)
Expand All @@ -73,7 +73,7 @@ decode.tree <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.conditional(small.crf, c(0,1,0,0), decode.exact)
#' d <- decode.conditional(Small$crf, c(0,1,0,0), decode.exact)
#'
#' @export
decode.conditional <- function(crf, clamped, decode.method, ...)
Expand Down Expand Up @@ -101,7 +101,7 @@ decode.conditional <- function(crf, clamped, decode.method, ...)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.cutset(small.crf, c(2))
#' d <- decode.cutset(Small$crf, c(2))
#'
#' @export
decode.cutset <- function(crf, cutset, engine = "default", start = apply(crf$node.pot, 1, which.max))
Expand All @@ -127,7 +127,7 @@ decode.cutset <- function(crf, cutset, engine = "default", start = apply(crf$nod
#'
#' library(CRF)
#' data(Small)
#' d <- decode.junction(small.crf)
#' d <- decode.junction(Small$crf)
#'
#' @export
decode.junction <- function(crf)
Expand All @@ -149,7 +149,7 @@ decode.junction <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.sample(small.crf, sample.exact, 10000)
#' d <- decode.sample(Small$crf, sample.exact, 10000)
#'
#' @export
decode.sample <- function(crf, sample.method, ...)
Expand All @@ -171,7 +171,7 @@ decode.sample <- function(crf, sample.method, ...)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.marginal(small.crf, infer.exact)
#' d <- decode.marginal(Small$crf, infer.exact)
#'
#' @export
decode.marginal <- function(crf, infer.method, ...)
Expand All @@ -194,7 +194,7 @@ decode.marginal <- function(crf, infer.method, ...)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.lbp(small.crf)
#' d <- decode.lbp(Small$crf)
#'
#' @export
decode.lbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
Expand All @@ -217,7 +217,7 @@ decode.lbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.trbp(small.crf)
#' d <- decode.trbp(Small$crf)
#'
#' @export
decode.trbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
Expand All @@ -239,7 +239,7 @@ decode.trbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
#'
#' library(CRF)
#' data(Small)
#' d <- decode.greedy(small.crf)
#' d <- decode.greedy(Small$crf)
#'
#' @export
decode.greedy <- function(crf, restart = 0, start = apply(crf$node.pot, 1, which.max))
Expand All @@ -261,7 +261,7 @@ decode.greedy <- function(crf, restart = 0, start = apply(crf$node.pot, 1, which
#'
#' library(CRF)
#' data(Small)
#' d <- decode.icm(small.crf)
#' d <- decode.icm(Small$crf)
#'
#' @export
decode.icm <- function(crf, restart = 0, start = apply(crf$node.pot, 1, which.max))
Expand All @@ -286,7 +286,7 @@ decode.icm <- function(crf, restart = 0, start = apply(crf$node.pot, 1, which.ma
#'
#' library(CRF)
#' data(Small)
#' d <- decode.block(small.crf, list(c(1,3), c(2,4)))
#' d <- decode.block(Small$crf, list(c(1,3), c(2,4)))
#'
#' @export
decode.block <- function(crf, blocks, decode.method = decode.tree, restart = 0, start = apply(crf$node.pot, 1, which.max), ...)
Expand Down Expand Up @@ -356,7 +356,7 @@ decode.block <- function(crf, blocks, decode.method = decode.tree, restart = 0,
#'
#' library(CRF)
#' data(Small)
#' d <- decode.ilp(small.crf)
#' d <- decode.ilp(Small$crf)
#'
#' @export
decode.ilp <- function(crf, lp.rounding = FALSE)
Expand Down
18 changes: 9 additions & 9 deletions R/infer.R
Expand Up @@ -14,7 +14,7 @@
#'
#' library(CRF)
#' data(Small)
#' i <- infer.exact(small.crf)
#' i <- infer.exact(Small$crf)
#'
#' @export
infer.exact <- function(crf)
Expand All @@ -38,7 +38,7 @@ infer.exact <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.chain(small.crf)
#' i <- infer.chain(Small$crf)
#'
#' @export
infer.chain <- function(crf)
Expand All @@ -62,7 +62,7 @@ infer.chain <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.tree(small.crf)
#' i <- infer.tree(Small$crf)
#'
#' @export
infer.tree <- function(crf)
Expand All @@ -89,7 +89,7 @@ infer.tree <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.conditional(small.crf, c(0,1,0,0), infer.exact)
#' i <- infer.conditional(Small$crf, c(0,1,0,0), infer.exact)
#'
#' @export
infer.conditional <- function(crf, clamped, infer.method, ...)
Expand Down Expand Up @@ -133,7 +133,7 @@ infer.conditional <- function(crf, clamped, infer.method, ...)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.cutset(small.crf, c(2))
#' i <- infer.cutset(Small$crf, c(2))
#'
#' @export
infer.cutset <- function(crf, cutset, engine = "default")
Expand Down Expand Up @@ -163,7 +163,7 @@ infer.cutset <- function(crf, cutset, engine = "default")
#'
#' library(CRF)
#' data(Small)
#' i <- infer.junction(small.crf)
#' i <- infer.junction(Small$crf)
#'
#' @export
infer.junction <- function(crf)
Expand All @@ -189,7 +189,7 @@ infer.junction <- function(crf)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.sample(small.crf, sample.exact, 10000)
#' i <- infer.sample(Small$crf, sample.exact, 10000)
#'
#' @export
infer.sample <- function(crf, sample.method, ...)
Expand All @@ -216,7 +216,7 @@ infer.sample <- function(crf, sample.method, ...)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.lbp(small.crf)
#' i <- infer.lbp(Small$crf)
#'
#' @export
infer.lbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
Expand All @@ -243,7 +243,7 @@ infer.lbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
#'
#' library(CRF)
#' data(Small)
#' i <- infer.trbp(small.crf)
#' i <- infer.trbp(Small$crf)
#'
#' @export
infer.trbp <- function(crf, max.iter = 10000, cutoff = 1e-4, verbose = 0)
Expand Down
14 changes: 7 additions & 7 deletions R/sample.R
Expand Up @@ -12,7 +12,7 @@
#'
#' library(CRF)
#' data(Small)
#' s <- sample.exact(small.crf, 100)
#' s <- sample.exact(Small$crf, 100)
#'
#' @export
sample.exact <- function(crf, size)
Expand All @@ -34,7 +34,7 @@ sample.exact <- function(crf, size)
#'
#' library(CRF)
#' data(Small)
#' s <- sample.chain(small.crf, 100)
#' s <- sample.chain(Small$crf, 100)
#'
#' @export
sample.chain <- function(crf, size)
Expand All @@ -56,7 +56,7 @@ sample.chain <- function(crf, size)
#'
#' library(CRF)
#' data(Small)
#' s <- sample.tree(small.crf, 100)
#' s <- sample.tree(Small$crf, 100)
#'
#' @export
sample.tree <- function(crf, size)
Expand All @@ -81,7 +81,7 @@ sample.tree <- function(crf, size)
#'
#' library(CRF)
#' data(Small)
#' s <- sample.conditional(small.crf, 100, c(0,1,0,0), sample.exact)
#' s <- sample.conditional(Small$crf, 100, c(0,1,0,0), sample.exact)
#'
#' @export
sample.conditional <- function(crf, size, clamped, sample.method, ...)
Expand Down Expand Up @@ -111,7 +111,7 @@ sample.conditional <- function(crf, size, clamped, sample.method, ...)
#'
#' library(CRF)
#' data(Small)
#' s <- sample.cutset(small.crf, 100, c(2))
#' s <- sample.cutset(Small$crf, 100, c(2))
#'
#' @export
sample.cutset <- function(crf, size, cutset, engine = "default")
Expand Down Expand Up @@ -139,7 +139,7 @@ sample.cutset <- function(crf, size, cutset, engine = "default")
#'
#' library(CRF)
#' data(Small)
#' s <- sample.junction(small.crf, 100)
#' s <- sample.junction(Small$crf, 100)
#'
#' @export
sample.junction <- function(crf, size)
Expand All @@ -163,7 +163,7 @@ sample.junction <- function(crf, size)
#'
#' library(CRF)
#' data(Small)
#' s <- sample.gibbs(small.crf, 100)
#' s <- sample.gibbs(Small$crf, 100)
#'
#' @export
sample.gibbs <- function(crf, size, burn.in = 1000, start = apply(crf$node.pot, 1, which.max))
Expand Down
Binary file modified data/Chain.RData
Binary file not shown.
Binary file modified data/Clique.RData
Binary file not shown.
Binary file modified data/Loop.RData
Binary file not shown.
Binary file modified data/Rain.RData
Binary file not shown.
Binary file modified data/Small.RData
Binary file not shown.
Binary file modified data/Tree.RData
Binary file not shown.
6 changes: 3 additions & 3 deletions man/CRF-package.Rd
Expand Up @@ -95,9 +95,9 @@ model }
\examples{
library(CRF)
data(Small)
decode.exact(small.crf)
infer.exact(small.crf)
sample.exact(small.crf, 100)
decode.exact(Small$crf)
infer.exact(Small$crf)
sample.exact(Small$crf, 100)
}
\author{
Ling-Yun Wu \email{wulingyun@gmail.com}
Expand Down
2 changes: 1 addition & 1 deletion man/clamp.crf.Rd
Expand Up @@ -34,7 +34,7 @@ on the clamped vector.
\examples{
library(CRF)
data(Small)
crf <- clamp.crf(small.crf, c(0, 0, 1, 1))
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))
}
\seealso{
\code{\link{make.crf}}, \code{\link{sub.crf}},
Expand Down
2 changes: 1 addition & 1 deletion man/clamp.reset.Rd
Expand Up @@ -26,7 +26,7 @@ the conditional potentials based on the clamped vector.
\examples{
library(CRF)
data(Small)
crf <- clamp.crf(small.crf, c(0, 0, 1, 1))
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))
clamp.reset(crf, c(0,0,2,2))
}
\seealso{
Expand Down
2 changes: 1 addition & 1 deletion man/decode.block.Rd
Expand Up @@ -32,6 +32,6 @@ modes algorithm
\examples{
library(CRF)
data(Small)
d <- decode.block(small.crf, list(c(1,3), c(2,4)))
d <- decode.block(Small$crf, list(c(1,3), c(2,4)))
}

2 changes: 1 addition & 1 deletion man/decode.chain.Rd
Expand Up @@ -21,6 +21,6 @@ algorithm.
\examples{
library(CRF)
data(Small)
d <- decode.chain(small.crf)
d <- decode.chain(Small$crf)
}

2 changes: 1 addition & 1 deletion man/decode.conditional.Rd
Expand Up @@ -27,6 +27,6 @@ input)
\examples{
library(CRF)
data(Small)
d <- decode.conditional(small.crf, c(0,1,0,0), decode.exact)
d <- decode.conditional(Small$crf, c(0,1,0,0), decode.exact)
}

2 changes: 1 addition & 1 deletion man/decode.cutset.Rd
Expand Up @@ -30,6 +30,6 @@ conditioning
\examples{
library(CRF)
data(Small)
d <- decode.cutset(small.crf, c(2))
d <- decode.cutset(Small$crf, c(2))
}

2 changes: 1 addition & 1 deletion man/decode.exact.Rd
Expand Up @@ -20,6 +20,6 @@ Exact decoding for small graphs with brute-force search
\examples{
library(CRF)
data(Small)
d <- decode.exact(small.crf)
d <- decode.exact(Small$crf)
}

0 comments on commit 9d72a3e

Please sign in to comment.