Skip to content

Instantly share code, notes, and snippets.

@chunseoklee
chunseoklee / inst_norm.py
Created October 9, 2019 03:45
tflite instance norm generation python
## tested on tf 2.0
from tensorflow import keras
import tensorflow as tf
from tensorflow.keras import layers
import tensorflow_addons as tfa
inputs = keras.Input(shape=(784,), name='digits')
x = tfa.layers.normalizations.InstanceNormalization()(inputs)
outputs = layers.Dense(10, activation='softmax', name='predictions')(x)
@chunseoklee
chunseoklee / last_model.py
Created June 11, 2019 12:41
last_model on tf experimental 1.14
# Note this needs to happen before import tensorflow.
import os
import sys
import tensorflow as tf
import argparse
os.environ['TF_ENABLE_CONTROL_FLOW_V2'] = '1'
class MnistLstmModel(object):
"""Build a simple LSTM based MNIST model.
@chunseoklee
chunseoklee / .emacs
Created May 8, 2019 10:31
my emacs configuration
;;;;;;;;; twoflower .emacs file
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("melpa-latest" . "http://melpa.org/packages/") t)
(unless (package-installed-p 'use-package)
@chunseoklee
chunseoklee / resolve_includes.py
Created September 8, 2018 11:46
resolve_includes script for clembed generation
# Copyright (c) 2016, 2017 ARM Limited.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
./dotnetcli/dotnet ./MSBuild.dll /p:ConfigurationGroup=Release ../src/System.Net.Ping/src/System.Net.Ping.csproj
https://wiki.tizen.org/wiki/Setup_of_Tizen_Infrastructure
https://github.com/openSUSE/open-build-service
https://en.opensuse.org/openSUSE:Build_Service_private_installation
https://en.opensuse.org/openSUSE:Build_Service_private_instance_boot_strapping
https://github.com/openSUSE/obs-build
@chunseoklee
chunseoklee / amd64_sysv.h
Created September 8, 2016 00:05 — forked from cutthroat/amd64_sysv.h
Simple C coroutines on AMD64/SysV
#pragma once
/* Each coroutine is represented by a pointer to its stack bottom. */
typedef void *co_coro;
/* The coroutine procedure takes the calling coroutine as its first argument. */
typedef void (*co_proc)(co_coro back);
/* Switch to new coroutine. The stack top must be 16 byte aligned.*/
@chunseoklee
chunseoklee / gist:332405f7dc620d5b2d97937e968785b8
Last active May 16, 2016 08:40
cmake for lldb-3.8 for arm/linux
cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/home/twoflower/dev/llvm-3.8 \
-DLLVM_ENABLE_DOXYGEN=0 -DLLVM_ENABLE_TERMINFO=0 \
-DLLVM_INCLUDE_EXAMPLES=0 -DLLVM_BUILD_RUNTIME=0 -DLLVM_INCLUDE_TESTS=0 \
-DLLVM_TARGETS_TO_BUILD='ARM;X86' \
-DLLDB_DISABLE_LIBEDIT=1 -DLLDB_DISABLE_CURSES=1 -DLLDB_DISABLE_PYTHON=1 \
/home/twoflower/dev/llvm/
@chunseoklee
chunseoklee / oneshot.sh
Last active February 20, 2017 17:23
build iotjs for nuttx on stm32f4
#!/bin/bash
# This script assumes that you have all dependencies on Ubuntu 14.04
# It will takes about 10 or more minites due to repo cloning.
#
# ./harmony ----- iotjs
# |
# ---- nuttx
mkdir harmony