Skip to content

Instantly share code, notes, and snippets.

View ashwani-rathee's full-sized avatar
☀️
day

Ashwani Rathee ashwani-rathee

☀️
day
View GitHub Profile
"""
Sigmoid activation function
"""
function sigmoid(Z)
A = 1 ./ (1 .+ exp.(.-Z))
return (A = A, Z = Z)
end
"""
@ashwani-rathee
ashwani-rathee / Basic-Neuron-Layer.jl
Created December 17, 2020 03:38
Blog Post 1 Contents
inputs = [1.0, 2.0, 3.0]
weights1 = [0.2, 0.8, -0.5, 1.0]
weights2 = [0.5, -0.91, 0.26, -0.5]
bias1 = 2.0
bias2 = 3.0
output = [inputs[1]*weights1[1] + inputs[2]*weights1[2] + inputs[3]*weights1[3] + inputs[4]*weights1[4] + bias1,
inputs[1]*weights2[1] + inputs[2]*weights2[2] + inputs[3]*weights2[3] + inputs[4]*weights2[4] + bias2]
@ashwani-rathee
ashwani-rathee / morphology_test_512.jl
Created March 23, 2021 14:32
Test Image for JuliaImages
# MIT License
begin
using Luxor, Random, Colors
Drawing(512, 512, "hello-world.png")
background("black")
sethue("white")
translate(50, 50)
radius = 30
grid = GridHex(O, radius, 2)
@ashwani-rathee
ashwani-rathee / Test.jl
Created March 25, 2021 18:11
Image Morphology Test
using BenchmarkTools
using ImageMorphology, TestImages,ColorTypes
function test()
img = TestImages.shepp_logan(512);
img_erode = Gray.(img); # keeps white objects white
img_erosion1 = erode(img_erode)
end
test()
@ashwani-rathee
ashwani-rathee / Test_morphology.py
Created March 25, 2021 18:12
Image Morphology Test
import cProfile
from skimage import data
from skimage.util import img_as_ubyte
from skimage import io
from skimage.morphology import disk
from skimage.morphology import erosion
def test():
orig_phantom = img_as_ubyte(data.shepp_logan_phantom())
selem = disk(6)
@ashwani-rathee
ashwani-rathee / Vertices.jl
Created March 26, 2021 14:57
Vertices for test image in polygon filling algorithm
vert=CartesianIndex{2}[]
push!(vert, CartesianIndex(2,2))
push!(vert, CartesianIndex(3,2))
push!(vert, CartesianIndex(4,2))
push!(vert, CartesianIndex(5,2))
push!(vert, CartesianIndex(6,3))
push!(vert, CartesianIndex(7,4))
push!(vert, CartesianIndex(8,4))
push!(vert, CartesianIndex(9,3))
push!(vert, CartesianIndex(10,2))
@ashwani-rathee
ashwani-rathee / results.md
Created May 15, 2021 16:34
Benchmark testresults

Benchmark Report for ImageDistances

Job Properties

  • Time of benchmark: 15 May 2021 - 21:57
  • Package commit: dirty
  • Julia commit: 6aaede
  • Julia command flags: None
  • Environment variables: None

Results

@ashwani-rathee
ashwani-rathee / run.jl
Last active May 20, 2021 16:49
MineCraft Game in Julia
# Instructions to get something running of Malmo
# In terminal 1 and a particular environment
# 1) Do `pip3 install gym lxml numpy pillow`
# 2) Do `git clone https://github.com/Microsoft/malmo.git`
# 3) Go to `cd malmo/MalmoEnv`
# 4) Do `(echo -n "malmomod.version=" && cat ../VERSION) > ./src/main/resources/version.properties`
# 5) Then run this file `julia run.jl`
# In terminal 2
@ashwani-rathee
ashwani-rathee / benchmark.md
Created May 23, 2021 04:35
A benchmark for PkgBenchmark

Benchmark Report for ImageDistances

Job Properties

  • Time of benchmark: 23 May 2021 - 10:4
  • Package commit: dirty
  • Julia commit: 6aaede
  • Julia command flags: None
  • Environment variables: None

Results

@ashwani-rathee
ashwani-rathee / Calculator.jl
Created June 28, 2021 14:27
INIT2022- Day 1
using Gtk
win = GtkWindow("Doritos Calculator", 300, 350)
set_gtk_property!(win,:resizable,false)
grid = GtkGrid()
set_gtk_property!(grid,:margin,20)
text = ""
b1 = GtkButton("1")