This is a simple demonstration of displaying training configuration in a TensorBoard, using text summaries.
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
local ts_utils = require("nvim-treesitter.ts_utils") | |
local M = {} | |
-- Credit: https://www.reddit.com/r/neovim/comments/tge2ty/python_toggle_fstring_using_treesitter/ | |
M.toggle_fstring = function() | |
local winnr = 0 | |
local cursor = vim.api.nvim_win_get_cursor(winnr) | |
local node = ts_utils.get_node_at_cursor() ---@type TSNode? |
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
-- Make sure TS syntax tree is updated when needed by plugin (with some throttling) | |
-- even if the `highlight` module is not enabled. | |
-- See https://github.com/nvim-treesitter/nvim-treesitter/issues/2492 | |
_G.TreesitterParse = function() | |
local lang = ts_parsers.ft_to_lang(vim.bo.filetype) | |
local parser = ts_parsers.get_parser(vim.fn.bufnr(), lang) | |
if parser then | |
parser:parse() | |
return true | |
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
from matplotlib import animation | |
from IPython.display import display_html | |
from IPython.display import HTML | |
def display_frames_as_gif(frames): | |
""" | |
Displays a list of frames as a gif, with controls | |
""" | |
fig, ax = plt.subplots() | |
patch = ax.imshow(frames[0]) |
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
#!/bin/bash | |
function print_osc() { | |
if [[ -n $TMUX ]] ; then | |
printf "\033Ptmux;\033\033]"; | |
else printf "\033]"; fi | |
} | |
function print_st() { | |
if [[ -n $TMUX ]] ; then |
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 tensorflow as tf | |
import tensorflow.contrib.layers as layers | |
from datetime import datetime | |
# MNIST input data | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) | |
def multilayer_perceptron(x): | |
fc1 = layers.fully_connected(x, 256, activation_fn=tf.nn.relu, scope='fc1') |
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
# in a courtesy of Caffe's filter visualization example | |
# http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb | |
def imshow_grid(data, height=None, width=None, normalize=False, padsize=1, padval=0): | |
''' | |
Take an array of shape (N, H, W) or (N, H, W, C) | |
and visualize each (H, W) image in a grid style (height x width). | |
''' | |
if normalize: | |
data -= data.min() |
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
brew install poppler | |
# 현재 디렉토리의 모든 *.pdf 패턴을 page1 만 추출해서 page1.*.pdf 로 저장 | |
for source_pdf in ./*.pdf; do | |
pdfseparate -f 1 -l 1 ${source_pdf} page1.${source_pdf} | |
done | |
pdfunite page1.* page1.merged.pdf |
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 the following snippet in your ipython notebook shell | |
import argparse | |
import tensorflow as tf | |
tf.app.flags.FLAGS = tf.python.platform.flags._FlagValues() | |
tf.app.flags._global_parser = argparse.ArgumentParser() |
NewerOlder