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
#@title Prompts | |
prompts = { | |
0:"unfortunate failed crayon drawing sketched while drunk looks awful, should have thrown it away, badly drawn crayon sketch of bill murray scribbled by a child while having a stroke seizure, wouldnt even put this on my fridge, by five year old could've drawn this", | |
50:"unfortunate failed crayon drawing sketched while drunk looks awful, should have thrown it away, badly drawn crayon sketch CARICATURE of bill murray scribbled by a child while having a stroke seizure, wouldnt even put this on my fridge, by five year old could've drawn this", | |
150:"crayon drawing sketched while drunk looks awful, should have thrown it away, badly drawn crayon sketch of bill murray scribbled by a child while having a stroke seizure, wouldnt even put this on my fridge, by five year old could've drawn this", | |
200:"crayon drawing sketched while drunk, hastily drawn crayon sketch of bill murray scribbled by a child while having a stroke seizure, wouldnt even put this on my fridge, by five ye |
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
""" | |
It looks like the Scene and Storyboard classes are intended to be used for creating animations by specifying keyframed curves for various parameters. The Scene class appears to allow users to specify the length of the scene and set keyframed curves for various attributes of the scene. The Storyboard class then allows users to create a sequence of Scene objects and specify default values for attributes that are not explicitly set in a given scene. | |
It looks like the KeyframedObject class is a subclass of the Keyframed class from the keyframed module, which provides some basic functionality for working with keyframed curves. The KeyframedObject class adds a weight attribute to the Keyframed class, which specifies the weight of the object when it is used in a storyboard. | |
The to_keyframed function provides a convenient way to convert various types of input into Keyframed objects, which can then be used as attributes in a Scene object. This function allows users to specify keyframed curves using strings, d |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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(MASS) | |
library(rpart) | |
random_pos_def_matrix = function(n){ | |
# https://math.stackexchange.com/a/358092/109246 | |
A = matrix(runif(n*n), n) | |
A = 0.5*(A+t(A)) | |
A + n*diag(n) | |
} |
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(tidyr) # just for gather() | |
simulate <- function(formulas | |
,obs_per_cell = 100 | |
,n_cells_per_group = 3 | |
,amp_mu = 50 | |
,amp_sd = 1 # this is only thing that impacts sd | |
,true_effect = 3 | |
,error_sd = 1 | |
){ |
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
install.packages('doParallel') | |
library(igraph) | |
library(foreach) | |
library(doParallel) | |
stopCluster(cl) | |
cl <- makeCluster(8) | |
registerDoParallel(cl) | |
sj_alg <- function(G){ |
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
# Finding best cut-off for constructing a categorical variable | |
# logistic regression | |
data(iris) | |
x0 = iris[iris$Species != 'setosa',] | |
plot(x0, col=x0$Species) | |
# Keep things simple for this demo | |
form = "is_virginica ~ Petal.Length + Petal.Width" |
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
# From the docs for mcglm::ahs | |
require(mcglm) | |
data(ahs, package="mcglm") | |
form1 <- Ndoc ~ income + age | |
form2 <- Nndoc ~ income + age | |
Z0 <- mc_id(ahs) | |
fit.ahs <- mcglm(linear_pred = c(form1, form2), | |
matrix_pred = list(Z0, Z0), link = c("log","log"), |
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
########################################################## | |
# Get data from the poisson demo at: # | |
# https://stats.idre.ucla.edu/r/dae/poisson-regression/ # | |
########################################################## | |
p <- read.csv("https://stats.idre.ucla.edu/stat/data/poisson_sim.csv") | |
p <- within(p, { | |
prog <- factor(prog, levels=1:3, labels=c("General", "Academic", | |
"Vocational")) | |
id <- factor(id) |
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
DIRS := $(filter dir%, $(shell ls)) | |
foo_sources := $(wildcard */source/foo.a) | |
foo_targets_prt := $(patsubst %.a, %.b, $(foo_sources)) | |
foo_targets := $(subst source,target, $(foo_targets_prt)) | |
bar_sources := $(wildcard */source/bar.a) | |
bar_x := $(patsubst %/bar.a, %/Y.a, $(bar_sources)) | |
bar_y := $(patsubst %/bar.a, %/Z.a, $(bar_sources)) | |
bar_targets := $(bar_x) $(bar_y) |