Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
kudkudak committed Feb 24, 2015
2 parents 95917ad + 2e19072 commit db119d3
Show file tree
Hide file tree
Showing 59 changed files with 3,773 additions and 3,371 deletions.
7 changes: 7 additions & 0 deletions R/gmum.errors.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Error codes

GMUM_WRONG_LIBRARY = "Error 20"
GMUM_WRONG_KERNEL = "Error 21"
GMUM_BAD_PREPROCESS = "Error 22"
GMUM_NOT_SUPPORTED = "Error 23"
GMUM_WRONG_PARAMS = "Error 24"
19 changes: 8 additions & 11 deletions R/gng-visualize.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library(igraph)

.gng.plot3d<-function(gngServer){
if("rgl" %in% rownames(installed.packages()) == TRUE){
g <- .gng.construct_igraph(gngServer)
g <- convertToGraph(gngServer)
.visualizeIGraphRGL(g)
}else{
warning("Please install rgl package to plot 3d graphs")
Expand Down Expand Up @@ -81,9 +81,7 @@ library(igraph)
}
}
.gng.plot2d.errors<-function(gngServer, vertex.color, layout){
tmp_name <- paste("tmp",sample(1:1000, 1),".graphml", sep="")
gngServer$exportToGraphML(tmp_name)
ig = .readFromGraphML(tmp_name )
ig <- convertToGraph(gngServer)

if(length(V(ig))==0) return

Expand All @@ -97,14 +95,12 @@ library(igraph)
}

.visualizeIGraph2dWithErrors(ig, vertex.color, layout, gngServer)

file.remove(tmp_name)
}

.gng.plot2d<-function(gngServer, vertex.color, layout){
tmp_name <- paste("tmp",sample(1:1000, 1),".graphml", sep="")
gngServer$exportToGraphML(tmp_name)
ig = .readFromGraphML(tmp_name )

ig <- convertToGraph(gngServer)

if(length(V(ig))==0) return

Expand All @@ -118,7 +114,6 @@ library(igraph)
}

.visualizeIGraph2d(ig, vertex.color, layout)
file.remove(tmp_name)
}

#' Visualize igraph using igraph plot
Expand Down Expand Up @@ -154,7 +149,9 @@ library(igraph)
.visualizeIGraph2d(ig, vertex.color, layout_2d)
title("Graph visualization")
errors_raw = gng$getErrorStatistics()
errors = log((errors_raw+1)/min(errors_raw+1))
plot(errors, type="l", lty=2, lwd=2, xlab="Time [s]", ylab="Mean error (log)", frame.plot=F)
errors_raw = errors_raw[5:length(errors_raw)]
errors = errors_raw
#errors = log((errors_raw)/min(errors_raw+1e-4))
plot(errors, type="l", lty=2, lwd=2, xlab="Batch", ylab="Mean batch error", frame.plot=F)
title("Mean error (log)")
}
Loading

0 comments on commit db119d3

Please sign in to comment.