Skip to content

Instantly share code, notes, and snippets.

View kinoko3's full-sized avatar

kinoko3 kinoko3

  • china
View GitHub Profile
@kinoko3
kinoko3 / first.py
Created May 13, 2018 02:23
vgg16-tranfer
import numpy as np
import tensorflow as tf
files = tf.train.match_filenames_once("train.tfrecord")
filename_queue = tf.train.string_input_producer(files, shuffle=False)
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
@kinoko3
kinoko3 / client
Created April 27, 2018 11:16
exhentai_rank
import pymongo
SERVER = '120.79.9.80'
PORT = 27017
DB_NAME = 'ex-rank'
COLLECTION = 'rank'
client = pymongo.MongoClient(SERVER, PORT)
db = client[DB_NAME]
@kinoko3
kinoko3 / main.py
Created April 14, 2018 08:02
tensorflow study
import tensorflow as tf
state = tf.Variable(0, name='test') # 变量
one = tf.constant(1) # 张量
new_value = tf.add(state, one)
update = tf.assign(state, new_value) #更新 new_value 替换state
init = tf.global_variables_initializer()
@kinoko3
kinoko3 / gradient_descent.py
Created April 4, 2018 02:28
machine_learning_linear_regression
import numpy as np
import matplotlib.pyplot as plt
#y=2 * (x1) + (x2) + 3
rate = 0.001
x_train = np.array([ [1, 2], [2, 1], [2, 3], [3, 5], [1, 3], [4, 2], [7, 3], [4, 5], [11, 3], [8, 7] ])
y_train = np.array([7, 8, 10, 14, 8, 13, 20, 16, 28, 26])
x_test = np.array([ [1, 4], [2, 2], [2, 5], [5, 3], [1, 5], [4, 1] ])
a = np.random.normal()
b = np.random.normal()
@kinoko3
kinoko3 / Search.cpp
Last active March 26, 2018 08:54
C++ STL Algorithm
#include <algorithm>
#include <iostream>
using namespace std;
// 使用搜索前先排序
int main(){
int A[10] = {1,1,2,3,4,5,6,10,9,15};
int *pos;
int idx;
bool h;
@kinoko3
kinoko3 / spider.py
Created March 17, 2018 02:40
solidot-wordcloud
import requests
from concurrent import futures
import pymongo
from lxml import etree
import datetime
MAX_WORKERS = 8
def get(url):
session = requests.session()