This file contains 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
*.acn | |
*.acr | |
*.alg | |
*.aux | |
*.bak | |
*.bbl | |
*.bcf | |
*.blg | |
*.brf | |
*.bst |
This file contains 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
var empty_list = function(selector) { | |
return selector(undefined, undefined, true); | |
}; | |
var prepend = function(el, list) { | |
return function(selector) { | |
return selector(el, list, false); | |
}; | |
}; | |
var head = function(list) { |
This file contains 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
require(igraph) | |
require(googleVis) | |
g <- graph.tree(24, children = 4) | |
set.seed(123) | |
E(g)$weight = rpois(23, 4) + 1 | |
edgelist <- get.data.frame(g) | |
colnames(edgelist) <- c("source","target","value") | |
edgelist$source <- LETTERS[edgelist$source] | |
edgelist$target <- LETTERS[edgelist$target] |
This file contains 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
library(sp) | |
library(rgdal) | |
library(raster) | |
library(ncdf) | |
##aez map | |
## extract data from shape file | |
GIS_DIR <- "./cropdata" | |
GIS_FILE <- "GCAM_region_AEZ" |
This file contains 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
## a batch of 3 4x4x2 images as input. We will upsample these to 8x8 | |
input_data = np.ones([3, 4, 4, 2]) | |
filter_shape = [3,3,4,2] # width, height, channels-out, channels-in | |
tconv_filter = np.ones(filter_shape) # make the filter all ones so that we can manually calculate the output | |
# obviously, having all the filter channels have the same coefficients defeats | |
# the purpose of having multiple channels, but this is just an example | |
output_shape = [8, 8, 4] # width, height, channels-out (notice we don't have the batch size dimension -- more on that later) | |
## set up the slots for the data |
This file contains 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
savepkgs <- function(saveloc) | |
{ | |
instpkg <- installed.packages() | |
cranpkg <- available.packages() | |
iscran <- instpkg[,'Package'] %in% cranpkg[,'Package'] | |
pkgdata <- data.frame(package=instpkg[,'Package'], iscran=iscran, instvers=instpkg[,'Version']) | |
write.csv(pkgdata, saveloc) | |
} | |
restore_pkgs <- function(pkglistfile) |