This file contains hidden or 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
sample_groups <- function(.data, ..., n, prop) { | |
slice_size <- dplyr:::check_slice_size(n, prop) | |
.data %>% | |
dplyr::group_by(...) %>% | |
tidyr::nest() %>% | |
dplyr::ungroup() %>% | |
{ | |
if (slice_size$type == "n") { | |
dplyr::slice_sample(., n=slice_size$n) | |
} else { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# Use postgres/example user/password credentials | |
version: '3.1' | |
services: | |
db: | |
image: postgres | |
restart: always | |
environment: | |
POSTGRES_USER: superintendent |
This file contains hidden or 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 .functional import revgrad | |
from torch.nn import Module | |
class RevGrad(Module): | |
def __init__(self, *args, **kwargs): | |
""" | |
A gradient reversal layer. | |
This layer has no parameters, and simply reverses the gradient | |
in the backward pass. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
body { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
background-color: #FAFAFA; | |
font-size: 1.1rem; | |
line-height: 1.3; | |
} | |
* { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 psychopy import data | |
import random | |
stairs = data.MultiStairHandler(conditions=[{'label': str(size), | |
'size': size, | |
'startVal': 10, | |
'stepType': 'lin', | |
'nTrials': 20, | |
'nUp': 1, | |
'nDown': 1, |
This file contains hidden or 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
import numpy as np | |
import re # regular expressions | |
import csv | |
from matplotlib import pyplot as pl | |
from scipy.stats.stats import pearsonr | |
def parse_dms(dms): | |
parts = re.split('[^\d\w]+', dms) | |
lat = dms2dd(parts[0], parts[1], parts[2]) |