<commit_before># coding: utf-8
import sys
import os
import tensorflow as tf
from PIL import Image
from six.moves import cPickle as Pickle

root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
sys.path.append(root_dir)
import dataset
import inference

IMAGE_HEIGHT = 45
IMAGE_WIDTH = 45
IMAGE_CHANNEL = 1
LEARNING_RATE_BASE = 1e-2
LEARNING_RATE_DECAY = 0.99
MOVING_AVERAGE = 0.99  # 平均滑动
MAX_STEPS = 300
ROTATE_ANGLE = 15
ROTATE_COUNTS = 6
BATCH_SIZE = 1000

# 路径设置
datasets_dir = os.path.join(root_dir, "datasets")
models_dir = os.path.join(root_dir, "models")

image_holder = tf.placeholder(tf.float32, [None, IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNEL])
label_holder = tf.placeholder(tf.int32, [None])


def train():
	"""
	
	:return: 
	"""
	# 读取数据集
	filenames = os.listdir(datasets_dir)<commit_msg>change traincount<commit_after># coding: utf-8
import sys
import os
import tensorflow as tf
from PIL import Image
from six.moves import cPickle as Pickle

root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
sys.path.append(root_dir)
import dataset
import inference

IMAGE_HEIGHT = 45
IMAGE_WIDTH = 45
IMAGE_CHANNEL = 1
LEARNING_RATE_BASE = 1e-2
LEARNING_RATE_DECAY = 0.99
MOVING_AVERAGE = 0.99  # 平均滑动
MAX_STEPS = 30000
ROTATE_ANGLE = 15
ROTATE_COUNTS = 6
BATCH_SIZE = 1000

# 路径设置
datasets_dir = os.path.join(root_dir, "datasets")
models_dir = os.path.join(root_dir, "models")

image_holder = tf.placeholder(tf.float32, [None, IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNEL])
label_holder = tf.placeholder(tf.int32, [None])


def train():
	"""
	
	:return: 
	"""
	# 读取数据集
	filenames = os.listdir(datasets_dir)
{'fraction_non_alphanumeric': 0.11557177615571776, 'fraction_numerical': 0.03527980535279805, 'mean_word_length': 5.231060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5955162', 'n_tokens_mistral': 721, 'n_tokens_neox': 667, 'n_words': 142}