Skip to content

Instantly share code, notes, and snippets.

View chengchingwen's full-sized avatar
💥
A Code Spontaneously Combust

Peter chengchingwen

💥
A Code Spontaneously Combust
View GitHub Profile
using Flux
using CUDA
import Optimisers
using NNlibCUDA
NNlibCUDA.softmaxalgo() = NNlibCUDA.CUDNN_SOFTMAX_ACCURATE
CUDA.math_mode!(CUDA.FAST_MATH; precision=:Float16)
# similar to Optimisers._grads! but accumulate
import Data.List (sortBy)
-- This exercise covers the first 6 and the 8th chapters of "Learn You a Haskell for Great Good!"
-- Chapter 1 - http://learnyouahaskell.com/introduction
-- Chapter 2 - http://learnyouahaskell.com/starting-out
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions
-- Chapter 5 - http://learnyouahaskell.com/recursion
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions
-- Chapter 8 - http://learnyouahaskell.com/making-our-own-types-and-typeclasses
@chengchingwen
chengchingwen / Chapter-1-6.hs
Created August 3, 2020 16:11
FLOLAC worksheet
import Data.List (sortBy)
-- This exercise covers the first 6 chapters of "Learn You a Haskell for Great Good!"
-- Chapter 1 - http://learnyouahaskell.com/introduction
-- Chapter 2 - http://learnyouahaskell.com/starting-out
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions
-- Chapter 5 - http://learnyouahaskell.com/recursion
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions
using Pkg.Artifacts
const ARTIFACTS_TOML = joinpath(@__DIR__, "Artifacts.toml")
const CLOUDFRONT_DISTRIB_PREFIX = "https://cdn.huggingface.co"
const S3_BUCKET_PREFIX = "https://s3.amazonaws.com/models.huggingface.co/bert"
const DEFAULT_CONFIG_NAME = "config.json"
const DEFAULT_WEIGHT_NAME = "pytorch_model.bin"
function register_model_artifact(name; config=DEFAULT_CONFIG_NAME, weight=DEFAULT_WEIGHT_NAME, download_prefix=CLOUDFRONT_DISTRIB_PREFIX)
@chengchingwen
chengchingwen / Plot_Examples.md
Created March 12, 2018 01:35 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot

中文輸入

tcsh

modify /etc/csh.cshrc add following

setenv LC_CTYPE en_US.ISO8859-1                                                                                              
setenv LC_ALL zh_TW.UTF-8                                                                                                    
setenv LANG zh_TW.UTF-8                                                                                                      

zbackup

freebsd zfs auto backup daemon written in Python3.5 with coroutine

Usage

put zbackup in /usr/local/bin and rename zbackup.rc to zbackup and put it inside /usr/local/etc/rc.d. And put zbackup.conf to where your zbackup_config, which is in rc.conf, point to. And don't forget zbackup_enable="YES"

=Emacs 基本語法=

指令

  • Ctr = C
  • ESC = ESC