Skip to content

Instantly share code, notes, and snippets.

View parthvshah's full-sized avatar
🎓
It's the Kessel run in 12 parsecs.

Parth Shah parthvshah

🎓
It's the Kessel run in 12 parsecs.
View GitHub Profile
@parthvshah
parthvshah / inp.py
Last active June 6, 2020 09:31
Input methods for Python
# For a string
# 'youremywholeworld'
a = input()
# For single integer input
# 9
a = int(input())
# For multiple (small) input
# 8 9

CNN

Training and inference phases of neural networks can be analysed individually.

For back propagation or training:

O(n^5) where n is the number of neurons, number of layers and number of iterations.

For forward propagation or inference:

# cook your dish here
graph = {
0: [1, 2],
1: [2],
2: [0],
3: [2]
}
# no of nodes
n = 4
@parthvshah
parthvshah / bench.cpp
Created May 5, 2021 06:22
(C++ STL) Benchmarking Find for Vector and Unordered Set
#include <vector>
#include <set>
#include <unordered_set>
#include <cassert>
#include <iostream>
#include <ctime>
#include <unistd.h>
#include <chrono>
#include <algorithm>
#include <vector>
@parthvshah
parthvshah / dfai.py
Last active October 19, 2022 00:22
Coding Challenge for Dragonfruit AI
"""
a) Images generated by the microscope
. . . . . . . . . .
. . . . . * . . . .
. . . * * * * . . .
. . * * * * * . . .
* * * * * * * . . .
. . * * * * * . . .
. . * * * . . . . .