Skip to content

Instantly share code, notes, and snippets.

@chenmoshushi
chenmoshushi / tf2_sampled_softmax_example.py
Created October 21, 2021 03:40 — forked from ronnygeo/tf2_sampled_softmax_example.py
Sampled Softmax Loss with keras and tf2 APIs
import numpy as np
import tensorflow as tf
import tensorflow.keras.layers as L
class SampledSoftmaxLoss:
"""
Class that instantiates a sampled softmax loss
...
@chenmoshushi
chenmoshushi / autoencoder.py
Created October 25, 2017 07:07 — forked from gabrieleangeletti/autoencoder.py
Denoising Autoencoder implementation using TensorFlow.
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class DenoisingAutoencoder(object):
""" Implementation of Denoising Autoencoders using TensorFlow.
@chenmoshushi
chenmoshushi / training.sh
Created November 13, 2015 06:28 — forked from christianroman/training.sh
Tesseract OCR training new font
#! /bin/bash
# build the environment
mkdir tessenv; cd tessenv
TROOT=`pwd`
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng
echo "Environment built"
# Get the stock english fonts from Google (old, but they work)
cd $TROOT/stockfonts
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz
#!/usr/bin/env python