Skip to content

Instantly share code, notes, and snippets.

View Svtter's full-sized avatar

修昊 Svtter

View GitHub Profile
@Svtter
Svtter / img_enhance.py
Created January 17, 2019 10:55
[img enhance] image enhance checker #keras
import matplotlib.pyplot as plt
from keras.preprocessing import image
inx = 5000
x = x_train[inx]
x = x.reshape((1, ) + x.shape)
i = 1
@Svtter
Svtter / App.vue
Created November 6, 2018 06:12
vue-cli instant prototyping example file.
<template>
<div id="app">
<h1>test</h1>
<p>{{ greeting }} world!</p>
</div>
</template>
<script>
export default {
data: function () {
@Svtter
Svtter / readme.md
Created September 6, 2018 02:43
[npz vs npy] a difference between them #npz #npy

The .npz file format is a zipped archive of files named after the variables they contain. The archive is not compressed and each file in the archive contains one variable in .npy format. For a description of the .npy format, see numpy.lib.format.

When opening the saved .npz file with load a NpzFile object is returned. This is a dictionary-like object which can be queried for its list of arrays (with the .files attribute), and for the arrays themselves.

@Svtter
Svtter / test.py
Created September 5, 2018 13:14
[test tensorflow] test tensorflow installation #tensorflow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
@Svtter
Svtter / shuffle.py
Created September 5, 2018 03:00
[shuffle data] shuffle the dataset when its ordered 打乱数据 #python #numpy
import numpy as np
# shuffle the data.
idx = np.random.permutation(len(x_all))
x_all, y_all = x_all[idx], y_all[idx]
@Svtter
Svtter / func.cc
Created July 10, 2018 03:24
opencv threshold cal
#include <opencv/cv.h>
#include <iostream>
using namespace cv;
// sum up given row
long int sumup(Mat row, int width)
{
std::cout << "Sumup" << std::endl;
long int total = 0;
@Svtter
Svtter / keras.markdown
Created February 6, 2018 06:39
Three useful network
# Put in const.py...:
# python2
class _const:
class ConstError(TypeError): pass
def __setattr__(self,name,value):
if self.__dict__.has_key(name):
raise self.ConstError, "Can't rebind const(%s)"%name
self.__dict__[name]=value
import sys
sys.modules[__name__]=_const()
@Svtter
Svtter / ros-tensorflow.py
Created December 22, 2017 01:50 — forked from bigsnarfdude/gist:4cbf171dd1ab0c13edfad3eaa5506745
[self-driving-car] ros tensorflow
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import String
from cv_bridge import CvBridge
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.models.image.imagenet import classify_image
@Svtter
Svtter / 1 - 数据挖掘的步骤.md
Created November 23, 2017 01:05 — forked from jyfeather/1 - 数据挖掘的步骤.md
数据挖掘基础知识
次序 简要步骤 具体步骤 作用
1 收集 信息收集 根据确定的数据分析对象,抽象出在数据分析中所需要的特征信息,然后选择合适的信息收集方法, 将收集到的信息存入数据库。对于海量数据,选择一个合适的数据存储和管理的数据仓库是至关重要的。
2 收集 数据集成 把不同来源、格式、特点性质的数据在逻辑上或物理上有机地集中,从而为企业提供全面的数据共享。
3 预处理 数据规约 数据规约技术可以用来得到数据集的规约表 示,它小得多,但仍然接近于保持原数据的完整性,并且规约后执行数据挖掘结果与规约前执行结果相同或几乎相同。
4 预处理 数据清理 在数据库中的数据有一些是不完整的 (有些感兴趣的属性缺少属性值)、含噪声的(包含错误的属性值),并且是不一致的(同样的信息不同的表示方式),因此需要进行数据清理,将完整、正确、一致的数据信息存入数据仓库中。
5 预处理 数据变换 通过平滑聚集、数据概化、规范化等 方式将数据转换成适用于数据挖掘的形式。对于有些实数型数据,通过概念分层和数据的离散化来转换数据也是重要的一步
6 挖掘 挖掘过程 根据数据仓库中的数据信息,选择合适的分析工具,应用统计方法、事例推理、决策树、规则推理、模糊集,甚至神经网络、遗传算法的方法处理信息,得出有用的分析信息。
7 挖掘 模式评估 从商业角度,由行业专家来验证数据挖掘结果的正确性。
8 挖掘 知识表示 将数据挖掘所得到的分析信息以可视化的方式呈现给用户,或作为新的知识存放在知识库中,供其他应用程序使用。