This file contains hidden or 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 mobula_op | |
import mxnet as mx | |
import numpy as np | |
from mobula_op.test_utils import assert_almost_equal | |
import time | |
def check_conv(data, weight, bias, kernel, stride, dilate, pad, num_filter, no_bias, conv): | |
data_mx = data.copy() | |
weight_mx = weight.copy() | |
bias_mx = bias.copy() |
This file contains hidden or 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 mxnet as mx | |
import count_time | |
mnist = mx.test_utils.get_mnist() | |
# Fix the seed | |
mx.random.seed(42) | |
# Set the compute context, GPU is available otherwise CPU | |
ctx = mx.gpu() if mx.test_utils.list_gpus() else mx.cpu() |
This file contains hidden or 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 mxnet as mx | |
import time | |
from distutils.util import strtobool | |
BT = time.time() | |
class CountTimeOP(mx.operator.CustomOp): | |
def __init__(self, first, cname): | |
super(CountTimeOP, self).__init__() | |
self.first = first |
This file contains hidden or 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 mxnet as mx | |
from mxnet import nd | |
import numpy as np | |
feature_stride = 16 | |
scales = (8, 16, 32) | |
ratios = (0.5, 1, 2) | |
rpn_pre_nms_top_n = 12000 | |
rpn_post_nms_top_n = 2000 | |
threshold = 0.7 |
This file contains hidden or 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 mxnet as mx | |
from mxnet import nd | |
import numpy as np | |
import time | |
np.random.seed(1234) | |
feature_stride = 16 | |
scales = (8, 16, 32) | |
ratios = (0.5, 1, 2) |
This file contains hidden or 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
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import pyplot as plt | |
import numpy as np | |
try: | |
import Queue | |
except: | |
import queue as Queue | |
# total time | |
T = 3 |
This file contains hidden or 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
#coding=utf-8 | |
from pydub import AudioSegment | |
from pydub.silence import split_on_silence | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pyaudio | |
import os | |
file_folder = 'D:/Mirai/English/3L英语第二册/' |
This file contains hidden or 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
#-*- coding:utf-8 -*- | |
import urllib2 | |
def GetHtml(word): | |
address = 'http://cn.bing.com/dict/search?&q=' + word; | |
try: | |
html = urllib2.urlopen(address).read().decode('utf-8') | |
return html | |
except: | |
return '' |
This file contains hidden or 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<vector> | |
#include<iostream> | |
#include<string> | |
#include <algorithm> | |
using namespace std; | |
namespace RPS | |
{ | |
enum state { rock = 0, paper = 1, scissors = 2, blank = 3 }; | |
struct player |
This file contains hidden or 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
// Ver 1.1 | |
// 更新时间:2014/7/22 18:36 | |
//更改了错误参数,对有规律的AI胜率较大 | |
//最差情况一般胜率不低于33.3% | |
namespace RPS | |
{ | |
enum state { rock = 0, paper = 1, scissors = 2, blank = 3 }; | |
struct player | |
{ |
NewerOlder