Skip to content

Instantly share code, notes, and snippets.

View Krucamper's full-sized avatar

Nattapong Chuenjai Krucamper

  • Thailand
  • 11:27 (UTC +07:00)
View GitHub Profile
@Krucamper
Krucamper / basic-cli-nestJs.sh
Created February 25, 2020 08:01
basic nest cli
# install nestJs cli
npm install -g @nestjs/cli
# create new project nestJs
nest new nestjs-tutorial
# change to directory
cd nestjs-tutorial
#run nestJs
@Krucamper
Krucamper / install-nest.md
Created February 25, 2020 07:51
install nest cli

npm install -g @nestjs/cli

@Krucamper
Krucamper / Kernel.php
Created December 2, 2019 10:09
update kernel for call command job
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@Krucamper
Krucamper / SendEmails.php
Created December 2, 2019 10:04
php artisan make:command SendEmails for laravel
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SendEmails extends Command
{
/**
* The name and signature of the console command.
@Krucamper
Krucamper / shuttle.csv
Last active November 24, 2019 13:16
imbalance data shuttle
A1 A2 A3 A4 A5 A6 A7 A8 A9 Class
85 0 88 -4 6 1 3 83 80 1
106 2 108 0 70 0 1 38 36 1
79 5 83 0 -46 0 4 130 126 1
76 0 81 -2 -40 13 5 122 118 1
104 7 105 7 70 0 1 35 34 1
101 -3 102 -4 72 0 1 29 28 1
81 -2 84 0 -18 -30 4 103 98 1
81 0 84 0 -12 29 4 97 94 1
79 0 83 0 -40 3 4 125 120 1
@Krucamper
Krucamper / test.py
Created November 23, 2019 18:12
CNN กับ Marvel Cinematic Universe (test model)
from PIL import Image
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import model
import os
classes = {'BlackPanther', 'DoctorStrange', 'IronMan', 'ScarletWitch', 'SpiderMan', 'Thor'}
train_dir = 'raw'
logs_train_dir = './train_logs'
@Krucamper
Krucamper / train.py
Created November 23, 2019 18:05
CNN กับ Marvel Cinematic Universe (train model)
import os
import numpy as np
import tensorflow as tf
import input_data
import model
N_CLASSES = 6
IMG_W = 64
IMG_H = 64
BATCH_SIZE = 10
@Krucamper
Krucamper / model.py
Created November 23, 2019 17:58
CNN กับ Marvel Cinematic Universe (model)
import tensorflow as tf
def inference(images, batch_size, n_classes):
with tf.compat.v1.variable_scope('conv1') as scope:
weights = tf.Variable(tf.random.truncated_normal(shape=[3, 3, 3, 64], stddev=1.0, dtype=tf.float32),
name='weights', dtype=tf.float32)
biases = tf.Variable(tf.constant(value=0.1, dtype=tf.float32, shape=[64]),
name='biases', dtype=tf.float32)
@Krucamper
Krucamper / img_genarate.py
Created November 23, 2019 17:54
CNN กับ Marvel Cinematic Universe (img genarate)
import os
from PIL import Image
raw_image = './raw'
prepro_image = './genarate'
classes = {'BlackPanther', 'DoctorStrange', 'IronMan', 'ScarletWitch', 'SpiderMan', 'Thor'}
def genarate_image():
for index, name in enumerate(classes):
class_path = raw_image + "/" + name + "/"
path_image = prepro_image +"/" + name +"/"
@Krucamper
Krucamper / ingredient.csv
Created November 16, 2019 20:38
Dataset Blending Problem
Ingredient Calcium Protein Fiber Cost
Limestone 0.38 0.0 0.0 10
Corn 0.001 0.09 0.02 30.5
Soybean 0.002 0.50 0.08 90.0