文章的结构如下,可以挑选感兴趣看看:
(1)一个案例
(2)案例的支付宝风控策略
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import torch | |
from torch import nn | |
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU | |
import torch.nn.functional as F | |
from torch.nn.modules.utils import _pair | |
from torch.autograd import Function | |
class DropBlock2D(nn.Module): | |
r"""Randomly zeroes 2D spatial blocks of the input tensor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for manjaro 需要手动切换内核 | |
sudo pacman -S openssh nfs-utils | |
sudo systemctl enable sshd | |
sudo systemctl start sshd | |
# for ubuntu | |
sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int n,res=9999999; | |
double max_d=0; | |
double d[52]; | |
int p[52]; | |
void dfs(int index, double sum_d, int sum_gold){ | |
if(sum_d>=max_d){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <math.h> | |
using namespace std; | |
int main() | |
{ | |
// input | |
int n,w,tmp,res=0,flag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int daxie[26],xiaoxie[26]; | |
string str; | |
void scan(string str){ | |
int len = str.size(); | |
for(char c : str){ | |
if(c <= 'Z' and c>='A'){ | |
daxie[c-'A']++; |
update 完整版迁移至:https://github.com/yanring/jianzhi-Offer-Leetcode
- 重建二叉树 -> https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
- √矩阵中的路径 -> https://leetcode.com/problems/word-search/
- 机器人的运动范围 -> 没找到
- 剪绳子(dp) -> 没找到
- √二进制中1的个数 -> https://leetcode.com/problems/number-of-1-bits/ ->(升级版)https://leetcode.com/problems/counting-bits/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begintime='2014-01-01'; | |
endtime='2017-01-01'; | |
total_value = 1000000; | |
name=['YNBY','GLDQ','WLY','SQJT','WHHX','GTDL','ZSYH','ZGPA','GTJA','DEEJ']'; | |
YNBY=w.wsd('000538.SZ','LOW,OPEN,CLOSE,HIGH',begintime,endtime); %调入云南白药股票四数据 | |
GLDQ=w.wsd('000651.SZ','LOW,OPEN,CLOSE,HIGH',begintime,endtime); %调入格力电器数据 | |
num=size(YNBY,1); %得到总历史数据个数 | |
data =[];%所有股票的数据 | |
a=[0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1]; %总仓位配比,为云南白药30%,格力电器30%,现金40% | |
p=[1,1,1]; %三者初始成本价格均为1,即云南白药单位一份1,格力电器单位一份1,现金单位一份为1 |