Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

{"uuid":"2b364c88-ca20-11ec-a5ec-d78639c02905","page":{"id":71315555,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"userInfo\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"userInfo\",\"type\",\"datasource\",\"subtype\",\"RESTQuery\",\"namespace\",null,\"resourceName\",\"REST-WithoutResource\",\"resourceDisplayName\",null,\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"paginationLimit\",\"\",\"body\",\"\",\"lastReceivedFromResourceAt\",null,\"queryDisabledMessage\",\"\",\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",true,\"paginationPaginationField\",\"\",\"headers\",\"\",\"showFailureToaster\",true,\"paginationEnabled\",false,\"query\",\"https://jsonbase.huhuhang.workers.dev/sspai/api/v1/user/{{urlparams.hash.slug}}/info/get\",\"playgroundQueryUuid\",\"\",\"playgroundQueryId\",null,\"privateParams\",[\"~#iL\",[]],\"runWhenPage
@huhuhang
huhuhang / tf2-install.sh
Last active September 26, 2019 07:17
shiyanlou 1080 course install tensorflow 2
# 解决线上环境的一些依赖问题,本地无需这些操作
pip install --upgrade pip msgpack setuptools h5py
pip uninstall tensorflow -y
pip install -U --ignore-installed wrapt
pip install tensorflow==2.0.0-rc1 # 安装 TensorFlow 2.0
@huhuhang
huhuhang / mc_cartpole.py
Last active July 30, 2019 06:35
使用策略梯度训练 CartPole 参考答案
import gym
import numpy as np
def mc_policy_gradient(env, theta, lr, episodes):
for episode in range(episodes): # 迭代 episode
episode = []
start_observation = env.reset() # 初始化环境
t = 0
while True:
@huhuhang
huhuhang / superupdate.sh
Last active July 12, 2019 07:58
备份一键更新 apt 源(via. oooldking)
#!/usr/bin/env bash
#
# Description: Choose a faster mirror for Linux script
#
# Copyright (C) 2017 - 2018 Oldking <oooldking@gmail.com>
#
# URL: https://www.oldking.net/697.html
#
RED='\033[0;31m'
@huhuhang
huhuhang / clean-macOS-thunder.sh
Created June 30, 2019 03:14
一键清除 macOS 迅雷多余组件
echo "→ Clean macOS Thunder?"
read -r -p "[Y/n] " input
case $input in
[yY][eE][sS]|[yY])
cd /Applications/Thunder.app/Contents/PlugIns/
rm -rf advertising.xlplugin
rm -rf featuredpage.xlplugin
rm -rf softmanager.xlplugin
rm -rf livestream.xlplugin
rm -rf feedback.xlplugin
@huhuhang
huhuhang / IMDB + TFIDF + LogReg.ipynb
Created March 25, 2019 05:38 — forked from prhbrt/IMDB + TFIDF + LogReg.ipynb
Notebook of TFIDF Logistic regression on IMDB sentiment dataset (provided by keras)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@huhuhang
huhuhang / data_clean.py
Created February 20, 2019 07:04
文本预处理依次返回:字到序号映射字典、序号到字映射字典、数据集中全部单字、数据集全文。
# *-* coding:utf-8 *-*
'''
modifed by ioiogoo
'''
def preprocess_file(path):
# 语料文本内容
files_content = ''
with open(path, 'r',encoding='UTF-8') as f:
for line in f: