Skip to content

Instantly share code, notes, and snippets.

View nlpjoe's full-sized avatar
🎯
Focusing

Jzzhou nlpjoe

🎯
Focusing
View GitHub Profile
@nlpjoe
nlpjoe / lccs.py
Created June 14, 2018 15:59
[最长公共子串]#python
def lccs(a, b):
flag = True
if len(a) > len(b):
a, b = b, a
flag = False
ret = ''
sigma = 0
last_position = 0
dp = [[0]*(len(b)+1) for i in range(len(a)+1)]
@nlpjoe
nlpjoe / latex.md
Created July 6, 2018 03:43
[Latex utils]#latex
\begin{equation}
\left\{
             \begin{array}{lr}
             x=\dfrac{3\pi}{2}(1+2t)\cos(\dfrac{3\pi}{2}(1+2t)), &  \\
             y=s, & 0\leq s\leq L,|t|\leq1.\\
             z=\dfrac{3\pi}{2}(1+2t)\sin(\dfrac{3\pi}{2}(1+2t)), &  
             \end{array}
\right.
\end{equation}
@nlpjoe
nlpjoe / ycm安装编译.md
Last active August 14, 2018 07:26
[ycm安装编译]
@nlpjoe
nlpjoe / blend.py
Last active August 16, 2018 08:20
[Kaggle utils] #python
"""Kaggle competition: Predicting a Biological Response.
Blending {RandomForests, ExtraTrees, GradientBoosting} + stretching to
[0,1]. The blending scheme is related to the idea Jose H. Solorzano
presented here:
http://www.kaggle.com/c/bioresponse/forums/t/1889/question-about-the-process-of-ensemble-learning/10950#post10950
'''You can try this: In one of the 5 folds, train the models, then use
the results of the models as 'variables' in logistic regression over
the validation data of that fold'''. Or at least this is the
implementation of my understanding of that idea :-)
@nlpjoe
nlpjoe / pdb.md
Created July 24, 2018 05:10
[pdu debug] #python

pdb调试命令

完整命令	简写命令	描述
args	a	打印当前函数的参数
break	b	设置断点
clear	cl	清除断点
condition	无	设置条件断点
continue	c或者cont	继续运行,知道遇到断点或者脚本结束
disable	无	禁用断点
@nlpjoe
nlpjoe / deeplearning.md
Last active June 9, 2020 02:50
[deeplearning utils] #python #ml

Resnet 164

      model:add(Convolution(3,nStages[1],3,3,1,1,1,1)) -- one conv at the beginning (spatial size: 32x32)
      model:add(layer(bottleneck, nStages[1], nStages[2], n, 1)) -- Stage 1 (spatial size: 32x32)
      model:add(layer(bottleneck, nStages[2], nStages[3], n, 2)) -- Stage 2 (spatial size: 16x16)
      model:add(layer(bottleneck, nStages[3], nStages[4], n, 2)) -- Stage 3 (spatial size: 8x8)

tensorboard使用

@nlpjoe
nlpjoe / lightgbm.py
Last active August 18, 2018 06:28
[调参]#python
# -*- coding: utf-8 -*-
"""
# 作者:wanglei5205
# 邮箱:[email protected]
# 博客:http://cnblogs.com/wanglei5205
# github:http://github.com/wanglei5205
"""
### 导入模块
import numpy as np
import pandas as pd
@nlpjoe
nlpjoe / keras.md
Last active June 9, 2020 02:49
[keras utils] #python #ml

JZTrainCategory.py训练策略

import keras.backend as K
import keras 
import numpy as np
import warnings


class JZTrainCategory(keras.callbacks.Callback):
@nlpjoe
nlpjoe / oh my zsh.md
Created September 3, 2018 03:00
[环境配置] #configure

ss

@nlpjoe
nlpjoe / magic.md
Created September 11, 2018 07:03
[Jupyter utils] #python

导出

jupyter nbconvert --to html EDA.ipynb

只导出图表和markdown

import IPython.core.display as di 
di.display_html('<script>jQuery(function() {if (jQuery("body.notebook_app").length == 0) { jQuery(".input_area").toggle(); jQuery(".prompt").toggle();}});</script>', raw=True)