Skip to content

Instantly share code, notes, and snippets.

View psychelzh's full-sized avatar
🎯
Focusing

Liang Zhang psychelzh

🎯
Focusing
View GitHub Profile
@psychelzh
psychelzh / listen1_aha_playlist.md
Created July 22, 2022 16:36
updated by Listen1(https://listen1.github.io/listen1/) at 2022/7/23 00:36:14

本歌单由Listen1创建, 歌曲数:0,歌单数:0,点击查看更多

@psychelzh
psychelzh / setup_hddm_win.md
Last active October 5, 2022 01:57
Setup HDDM on Windows
@psychelzh
psychelzh / r_http.md
Last active October 5, 2022 02:03
Simple http response from R

Use API of facemorph

StyleGAN2 is very powerful. The project facemorph is based on it, and there is an API for the website. Here I show an example how to use the API from R, which is basically based on {httr} pacakge.

library(httr)
api_url <- "https://api.facemorph.me/api/encodeimage/"
resp &lt;- POST(
@psychelzh
psychelzh / simulate_adaption.R
Last active October 21, 2022 06:59
Simulate an adaption of 2/1 rule
library(tidyverse)
#' Simulate Trials for Adaptive Rules
#'
#' @param num_runs The total runs.
#' @param streak_rule The win-streak required to increase level.
#' @param fast_mode Should the first run ignore `streak_rule`?
#' @param level_init The initial level.
#' @param level_limits A 1-by-2 vector specifying lower and higher limits for
#' levels.