Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ayush Shridhar ayush1999

🎯
Focusing
View GitHub Profile
@ayush1999
ayush1999 / ngrams=1.txt
Last active Apr 1, 2019
component model with ngrams=1, 2
View ngrams=1.txt
X: (101423, 1934), y: (101423,)
X_train: (91280, 1934), y_train: (91280,)
X_test: (10143, 1934), y_test: (10143,)
No confidence threshold - 10143 classified
[[0 0 0 ... 0 0 0]
[0 0 0 ... 0 0 0]
[0 0 3 ... 0 0 0]
...
[0 0 0 ... 2 0 0]
[0 0 0 ... 0 2 0]
@ayush1999
ayush1999 / linear.jl
Created Nov 27, 2018
trying out linear regression from scratch
View linear.jl
mutable struct LinearRegression
inputs::Any
targets::Any
params::Any
end
function LinearRegression(a::Any, b::Any)
params = zeros(size(a, 2), 1)
err = []
for i=1:size(a, 1)
View densenet121.jl
flipkernel(x) = x[end:-1:1, end:-1:1, :, :]
begin
edge_1 = (Flux.unsqueeze)(weights["conv1/bn_w_0"], (ndims(weights["conv1/bn_w_0"]) + 1) - 1)
edge_2 = (Flux.unsqueeze)(weights["conv1/bn_b_0"], (ndims(weights["conv1/bn_b_0"]) + 1) - 1)
edge_3 = (Flux.unsqueeze)(weights["conv2_1/x1/bn_w_0"], (ndims(weights["conv2_1/x1/bn_w_0"]) + 1) - 1)
edge_4 = (Flux.unsqueeze)(weights["conv2_1/x1/bn_b_0"], (ndims(weights["conv2_1/x1/bn_b_0"]) + 1) - 1)
edge_5 = (Flux.unsqueeze)(weights["conv2_1/x2/bn_w_0"], (ndims(weights["conv2_1/x2/bn_w_0"]) + 1) - 1)
edge_6 = (Flux.unsqueeze)(weights["conv2_1/x2/bn_b_0"], (ndims(weights["conv2_1/x2/bn_b_0"]) + 1) - 1)
edge_7 = (Flux.unsqueeze)(weights["conv2_2/x1/bn_w_0"], (ndims(weights["conv2_2/x1/bn_w_0"]) + 1) - 1)
edge_8 = (Flux.unsqueeze)(weights["conv2_2/x1/bn_b_0"], (ndims(weights["conv2_2/x1/bn_b_0"]) + 1) - 1)
@ayush1999
ayush1999 / generated_file.jl
Last active May 15, 2018
DenseNet121 in Julia (using ONNX and Flux)
View generated_file.jl
Mul(a,b,c) = b .* reshape(c, (1,1,size(c)[a],1))
Add(axis, A ,B) = A .+ reshape(B, (1,1,size(B)[1],1))
begin
c_1 = Conv(weights["fc6_w_0"], weights["fc6_b_0"], stride=(1, 1), pad=(0, 0))
c_2 = Conv(weights["conv4_blk_w_0"], Float32[0.0], relu, stride=(1, 1), pad=(0, 0))
c_3 = Conv(weights["conv3_blk_w_0"], Float32[0.0], relu, stride=(1, 1), pad=(0, 0))
c_4 = Conv(weights["conv2_blk_w_0"], Float32[0.0], relu, stride=(1, 1), pad=(0, 0))
c_5 = Conv(weights["conv1_w_0"], Float32[0.0], relu, stride=(2, 2), pad=(3, 3))
c_6 = Conv(weights["conv2_1/x2_w_0"], Float32[0.0], relu, stride=(1, 1), pad=(1, 1))
c_7 = Conv(weights["conv2_1/x1_w_0"], Float32[0.0], relu, stride=(1, 1), pad=(0, 0))
@ayush1999
ayush1999 / coala log
Created Nov 8, 2017
Log of running Coala on Keras repo.
View coala log
[WARNING][15:22:39] 'cli' is an internally reserved section name. It may have been generated into your coafile while running coala with `--save`. The settings in that section will inherit implicitly to all sections as defaults just like CLI args do.Please change the name of that section in your coafile to avoid any unexpected behavior.
Please enter a value for the setting "use_spaces" (True if spaces are to be used instead of tabs.) needed by SpaceConsistencyBear for section "cli":
False
Executing section cli...
[INFO][15:22:55] Applied 'ApplyPatchAction' on 'iris.py' from 'SpaceConsistencyBear'.
[INFO][15:22:55] Applied 'ApplyPatchAction' on 'iris.py' from 'SpaceConsistencyBear'.
[INFO][15:22:55] Applied 'ApplyPatchAction' on 'iris.py' from 'SpaceConsistencyBear'.
[INFO][15:22:55] Applied 'ApplyPatchAction' on 'diabetes.py' from 'SpaceConsistencyBear'.
[INFO][15:22:55] Applied 'ApplyPatchAction' on 'diabetes.py' from 'SpaceConsistencyBear'.
View .coafile test #2
[WARNING][21:29:09] 'cli' is an internally reserved section name. It may have been generated into your coafile while running coala with `--save`. The settings in that section will inherit implicitly to all sections as defaults just like CLI args do.Please change the name of that section in your coafile to avoid any unexpected behavior.
Please enter a value for the setting "use_spaces" (True if spaces are to be used instead of tabs.) needed by SpaceConsistencyBear for section "cli":
False
Executing section cli...
[WARNING][21:29:13] No files matching '/home/ayush99/Desktop/ML/linear_regression 2.py' were found.
[WARNING][21:29:13] No files matching '/home/ayush99/Desktop/ML/linear_regression 1.py' were found.
[INFO][21:29:14] Applied 'ApplyPatchAction' on 'logistic_regression.py' from 'SpaceConsistencyBear'.
[INFO][21:29:14] Applied 'ApplyPatchAction' on 'multiple_linear_regression.py' from 'SpaceConsistencyBear'.
[INFO][21:29:14] Applied 'ApplyPatchAction' on 'multiple_linear_regression.py' from 'SpaceConsis
@ayush1999
ayush1999 / results:
Created Oct 31, 2017
Running Coala on a project.
View results:
[WARNING][23:30:34] Implicit 'Default' section inheritance is deprecated. It will be removed soon. To silence this warning remove settings in the 'Default' section from your coafile. You can use dots to specify inheritance: the section 'all.python' will inherit all settings from 'all'.
Executing section python...
[WARNING][23:30:35] No files matching '/home/ayush99/Desktop/ML/keras/coalib/**/*.py' were found.
[WARNING][23:30:35] No files matching '/home/ayush99/Desktop/ML/keras/tests/**/*.py' were found.
[WARNING][23:30:35] No files matching '/home/ayush99/Desktop/ML/keras/coala' were found.
[INFO][23:30:35] Applied 'ApplyPatchAction' on 'diabetes.py' from 'SpaceConsistencyBear'.
[INFO][23:30:35] Applied 'ApplyPatchAction' on 'iris.py' from 'SpaceConsistencyBear'.
[INFO][23:30:35] Applied 'ApplyPatchAction' on 'iris.py' from 'QuotesBear'.
[INFO][23:30:35] Applied 'ApplyPatchAction' on 'iris.py' from 'QuotesBear'.
[INFO][23:30:35] Applied 'ApplyPatchAction' on 'iris.py' from 'QuotesBear'.
@ayush1999
ayush1999 / socket_client.py
Created Aug 8, 2017 — forked from tuxmartin/socket_client.py
Python socket - server and client example (push notifications)
View socket_client.py
import socket
host = 'localhost'
port = 1234
buf = 1024
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))
print "Sending 'test1\\n'"