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
" Note, to set this up, run ':PluginInstall' in vim | |
" Then to set up autocomplete, | |
" | |
" cd ~/.vim/bundle/YouCompleteMe && python install.py | |
" | |
set nocompatible " required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize |
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
clear | |
clc | |
hold('on'); | |
x = 0:0.01:5; | |
y = x.^2; | |
p = plot(x, y, 'LineWidth', 2, 'Color', [.2, .5, 1]); | |
axis([0, 5, 0, 25]) | |
tangent = 2*x-1; |
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 tensorflow as tf | |
def prelu(x, scope, decoder=False): | |
''' | |
Performs the parametric relu operation. This implementation is based on: | |
https://stackoverflow.com/questions/39975676/how-to-implement-prelu-activation-in-tensorflow | |
For the decoder portion, prelu becomes just a normal prelu | |
INPUTS: | |
- x(Tensor): a 4D Tensor that undergoes prelu | |
- scope(str): the string to name your prelu operation's alpha variable. |
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 tensorflow as tf | |
from tensorflow.contrib.layers.python.layers import initializers | |
slim = tf.contrib.slim | |
''' | |
============================================================================ | |
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation | |
============================================================================ | |
Based on the paper: https://arxiv.org/pdf/1606.02147.pdf | |
''' |
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
const int MPIN = 2; //motor pwm out pin | |
const int DPIN = A0; // voltage distance sensor pin | |
float steady_state_error; | |
float voltage; | |
float target; | |
float accumulate; | |
void setup() | |
{ |
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
function net = resnet(input_shape) | |
%RESNET Creates a resnet model with imput_size | |
n = imageInputLayer(input_shape,'Name','input'); | |
n = layerGraph(n); | |
n = bottleneck(256, ['bottleneck_' char(string(1))], n) | |
end | |
function graph = bottleneck(depth, name, graph) | |
head = graph.Layers(end).Name; |
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
;TI-84 Plus CE Include File | |
;Various Parts Contributed by | |
;- BrandonW | |
;- calc84 | |
;- MateoConLechuga | |
;- Runer112 | |
;- tr1p1ea | |
;- Kerm Martian | |
;- Texas Instruments (ti83plus.inc) |
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 <cstdio> | |
class Rational{ | |
int n, d; //numerator, denominator | |
int gcf(int x, int y, int z){ return y&&(z=x%y) ? gcf(y,z,0) : y;} | |
void r(){int f=gcf(n, d, 0); n/=f; d/=f;} //reduce | |
public: | |
Rational operator+(Rational R){return Rational(n*R.d+d*R.n, d*R.d);} | |
Rational operator-(Rational R){return Rational(n*R.d-d*R.n, d*R.d);} | |
Rational operator*(Rational R){return Rational(n*R.n, d*R.d);} | |
Rational operator/(Rational R){return Rational(n*R.d, d*R.n);} |
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
struct Student { | |
int n, c[9], g[9]; | |
void SetGrades(int *C, char *G, int N){ | |
for (int i(0); i < N; ++i){ | |
AddGrade(C[i], G[i]); | |
} | |
} | |
void AddGrade(int C, char G){ | |
c[n] = C; | |
g[n++] = G; |
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 keras.backend as K | |
def FScore2(y_true, y_pred): | |
''' | |
The F score, beta=2 | |
''' | |
B2 = K.variable(4) | |
OnePlusB2 = K.variable(5) | |
pred = K.round(y_pred) | |
tp = K.sum(K.cast(K.less(K.abs(pred - K.clip(y_true, .5, 1.)), 0.01), 'float32'), -1) |