reproducible-research

How Do I Set.Seed for simulation in R to attain reproducibility on Windows OS

走远了吗. 提交于 2021-02-18 18:59:48
问题 I have a simulation done with the below function in R : ## Load packages and prepare multicore process library(forecast) library(future.apply) plan(multisession) library(parallel) library(foreach) library(doParallel) n_cores <- detectCores() cl <- makeCluster(n_cores) registerDoParallel(cores = detectCores()) set.seed(1) bootstrap1 <- function(n, phi){ ts <- arima.sim(n, model = list(ar=phi, order = c(1, 1, 0)), sd = 1) #ts <- numeric(n) #ts[1] <- rnorm(1) #for(i in 2:length(ts)) # ts[i] <- 2

“TypeError: 'Session' object is not callable” error running sess = tf.compat.v1.Session()(graph=tf.compat.v1.get_default_graph(), config=session_conf)

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 17:37:20
问题 I'm trying to set seeds and configure keras settings to ensure my experiments are reproducible. When I run the following (based on code in an answer to this question): # Import libraries import numpy as np import pandas as pd import tensorflow as tf from tensorflow.keras.models import load_model from tensorflow.keras.regularizers import l2 # for setting seeds and configuring keras so that experiments are reproducible from numpy.random import seed import random as rn import os from tensorflow

“TypeError: 'Session' object is not callable” error running sess = tf.compat.v1.Session()(graph=tf.compat.v1.get_default_graph(), config=session_conf)

一世执手 提交于 2021-02-11 17:37:20
问题 I'm trying to set seeds and configure keras settings to ensure my experiments are reproducible. When I run the following (based on code in an answer to this question): # Import libraries import numpy as np import pandas as pd import tensorflow as tf from tensorflow.keras.models import load_model from tensorflow.keras.regularizers import l2 # for setting seeds and configuring keras so that experiments are reproducible from numpy.random import seed import random as rn import os from tensorflow

How to trace-back exact software version(s) used to generate result-files in a snakemake workflow

♀尐吖头ヾ 提交于 2021-02-11 06:35:34
问题 Say I'm following the best practise workflow suggested for snakemake. Now I'd like to know how (i.e. which version) a given file, say plots/myplot.pdf , was generated. I found this surprisingly hard if not impossible only having the result folder at hand. In more detail, say I was generated the results using. snakemake --use-conda --conda-prefix ~/.conda/myenvs which will resolve and download the conda-environments specified in the rule below (copied from the documentation): rule NAME: input:

TensorFlow - reproducing results when using dropout

纵然是瞬间 提交于 2021-02-07 20:58:51
问题 I am training a neural network using dropout regularization. I save the weights and biases the network is initialized with, so that I can repeat the experiment when I get good results. However, the use of dropout introduces some randomness in the network: since dropout drops units randomly, each time I rerun the network, different units are being dropped - even though I initialize the network with the exact same weights and biases (if I understand this correctly). Is there a way to make the

TensorFlow - reproducing results when using dropout

。_饼干妹妹 提交于 2021-02-07 20:57:55
问题 I am training a neural network using dropout regularization. I save the weights and biases the network is initialized with, so that I can repeat the experiment when I get good results. However, the use of dropout introduces some randomness in the network: since dropout drops units randomly, each time I rerun the network, different units are being dropped - even though I initialize the network with the exact same weights and biases (if I understand this correctly). Is there a way to make the

create references in each section in Rmarkdown

橙三吉。 提交于 2021-02-07 09:01:07
问题 I want to use Rmarkdown but what I've read is that when creating a bibliography using pandoc, references go at the end of the document: pandoc/citeproc issues: multiple bibliographies, nocite, citeonly So even if I have a parent document named thesis.Rmd, I assume that all references would go at the end of that file. I need that each thesis' chapter or section must have its own references, is there any other way to solve this than putting a bibliography header in each chapter I write and then

Why are my results still not reproducible?

≯℡__Kan透↙ 提交于 2021-02-07 06:39:11
问题 I want to get reproducible results for a CNN. I use Keras and Google Colab with GPU. In addition to recommendations to insert certain code snippets, which should allow a reproducibility, I also added seeds to the layers. ###### This is the first code snipped to run ##### !pip install -U -q PyDrive from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from oauth2client.client import GoogleCredentials # Authenticate and create the PyDrive client

dput a long list - shorten list but preserve structure

佐手、 提交于 2021-01-04 07:15:42
问题 If we want to make a reproducible question on a complex/large dataset for SO, we can use dput(head(df)) to reduce the size. Is there a similar approach to reduce the size of complex nested lists with varying list lengths? I'm thinking an approach could be to take the first few elements from each list (say first 3) irrespective of individual list type ( numeric , character etc.) and nested structure but I'm not sure how to do this. #sample nested list L <- list( list(1:10), list( list(1:10),

dput a long list - shorten list but preserve structure

北城以北 提交于 2021-01-04 07:12:05
问题 If we want to make a reproducible question on a complex/large dataset for SO, we can use dput(head(df)) to reduce the size. Is there a similar approach to reduce the size of complex nested lists with varying list lengths? I'm thinking an approach could be to take the first few elements from each list (say first 3) irrespective of individual list type ( numeric , character etc.) and nested structure but I'm not sure how to do this. #sample nested list L <- list( list(1:10), list( list(1:10),