Skip to content

Instantly share code, notes, and snippets.

View lkevinzc's full-sized avatar
🎯
Learning

zclzc lkevinzc

🎯
Learning
View GitHub Profile
  1. Before adding new feature or a PR is merged at remote, at main branch:
  • git fetch: get updates from remote repo
  • git reset --hard origin/main: sync local main to be the same as remote main; this can remove any changes at local, so should be called before adding any changes
  1. To create new features:
  • git checkout -b feature-name: new a branch named "feature-name"
  • modify codes and commit
  • (if at the same time remote main is changed due to another PR) git checkout main; git fetch; git reset --hard origin/main then git checkout feature-name; git rebase origin/main and resolve any conflicts
  • git push -u origin feature-name for the first time to push a local branch to remote or simply git push if the branch already exists at remote
  1. Do pull request.
@lkevinzc
lkevinzc / losse.py
Last active January 27, 2024 03:00
Codes of Losse-FTL, an online regressor capable of learning world models for MBRL. See ICLR2024 paper at https://arxiv.org/abs/2401.13034. In this demo we learn from a non-stationary data stream with sine target function.
import math
from typing import NamedTuple, Tuple
import chex
import jax
import jax.numpy as jnp
import numpy as np
class LosseParams(NamedTuple):
import functools
import time
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
from absl import app, flags, logging
FLAGS = flags.FLAGS
@lkevinzc
lkevinzc / barrier.rs
Created October 23, 2021 04:08
Snippets
use std::sync::Arc;
use tokio::sync::{Barrier, Notify};
use tokio::time::{sleep, Duration};
#[tokio::main]
async fn main() {
let barrier = Arc::new(Barrier::new(10));
let all_ready_notify = Arc::new(Notify::new());
let notify_receiver = all_ready_notify.clone();
for i in 0..10 {
@lkevinzc
lkevinzc / detection.md
Last active January 19, 2021 06:37
a benchmark on model serving: i/o format, data processing and beyond
  • 400 images
  • DB network for detection
  • single V100 GPU
serialization image encoding total processing time (s) data size
msgpack jpeg bytes 22, 21, 22 332,830
bson jpeg bytes 22, 22, 22 332,840
json jpeg bytes bytes not JSON serializable
json base64 23, 23, 23 443,774
@lkevinzc
lkevinzc / a-tour-of-paddle.py
Last active October 16, 2020 15:27
a glance at paddle framework
"""
[DS-CV Paddle Sharing]
16/09/2020
zichen.liu
"""
"""
Concepts (1): Variables
"""