Skip to content

Instantly share code, notes, and snippets.

View shayuewt's full-sized avatar
🎯
Focusing

wangt shayuewt

🎯
Focusing
View GitHub Profile
@shayuewt
shayuewt / apply并行加速.ipynb
Last active January 24, 2022 11:20
apply并行加速
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shayuewt
shayuewt / unzip_on_ubuntu.sh
Last active November 14, 2020 14:22
Ubuntu上解压zip文件发生乱码
unzip -O CP936 xxx.zip
# 由于zip格式中并没有指定编码格式,Windows下生成的zip文件中的编码是GBK/GB2312等。因此,导致这些zip文件在Linux下解压时出现乱码问题,
# 因为Linux下的默认编码是UTF8。其中制定的字符可以是CP936、GBK、GB18030三种中的任一一种
@shayuewt
shayuewt / tf_struct_example.py
Last active April 12, 2020 01:21
[使用tf2.0对结构化问题训练样例] #tf2.0
import tensorflow as tf
from tensorflow.keras import model, layers
""" 设置显存大小,这里设置了2GB """
gpus = tf.config.experimental.list_physical_devices(device_type='GPU')
tf.config.experimental.set_virtual_device_configuration(
gpus[0],
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=2048)]
)
@shayuewt
shayuewt / tf_gen_graph.py
Last active April 11, 2020 15:05
[tensorflow构建普通网络] #tf2.0
# 首先清除已经定义的计算图
tf.keras.backend.clear_session()
# 定义入口
model = models.Sequential()
# 增加第一层,需要定义出输入的维度
model.add(layers.Dense(20, activation='relu', input_shape=(15, )))
# 增加第二层
model.add(layers.Dense(10, activation='relu'))
# 增加第三层
model.add(layers.Dense(1, activation='sigmoid'))
@shayuewt
shayuewt / tf_GPU_memory_config.py
Last active April 11, 2020 15:05
[tensorflow为GPU设置显存大小] #tf2.0
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices(device_type='GPU')
tf.config.experimental.set_virtual_device_configuration(
gpus[0],
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=2048)]
)
@shayuewt
shayuewt / git_proxy.sh
Last active April 11, 2020 15:17 — forked from laispace/git 设置和取消代理
[git设置和取消代理] #git
# 设置代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy