Skip to content

Commit 4cb4861

Browse files
Merge branch 'master' into master
2 parents 2e67226 + 9d648d8 commit 4cb4861

31 files changed

+48175
-2
lines changed

.all-contributorsrc

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,62 @@
119119
"contributions": [
120120
"code"
121121
]
122+
},
123+
{
124+
"login": "Aravindha1234u",
125+
"name": "T3cH_W1z4rD",
126+
"avatar_url": "https://avatars0.githubusercontent.com/u/52521300?v=4",
127+
"profile": "https://aravindha1234u.github.io",
128+
"contributions": [
129+
"code"
130+
]
131+
},
132+
{
133+
"login": "Meghana-12",
134+
"name": "Meghana Varanasi",
135+
"avatar_url": "https://avatars0.githubusercontent.com/u/44519203?v=4",
136+
"profile": "https://github.com/Meghana-12",
137+
"contributions": [
138+
"code"
139+
]
140+
},
141+
{
142+
"login": "mendoza",
143+
"name": "David Mendoza",
144+
"avatar_url": "https://avatars1.githubusercontent.com/u/30415552?v=4",
145+
"profile": "https://github.com/mendoza",
146+
"contributions": [
147+
"code"
148+
]
149+
},
150+
{
151+
"login": "dkarmy12",
152+
"name": "dkarmy12",
153+
"avatar_url": "https://avatars1.githubusercontent.com/u/55491427?v=4",
154+
"profile": "https://github.com/dkarmy12",
155+
"contributions": [
156+
"code"
157+
]
158+
},
159+
{
160+
"login": "madhavmehndiratta",
161+
"name": "Madhav Mehndiratta",
162+
"avatar_url": "https://avatars3.githubusercontent.com/u/43489174?v=4",
163+
"profile": "http://madhavmehndiratta.me",
164+
"contributions": [
165+
"code"
166+
]
167+
},
168+
{
169+
"login": "yogeshwaran01",
170+
"name": "YOGESHWARAN R",
171+
"avatar_url": "https://avatars1.githubusercontent.com/u/66836092?v=4",
172+
"profile": "http://www.linkedin.com/in/yogeshwaran01",
173+
"contributions": [
174+
"code"
175+
]
122176
}
123-
,
177+
],
124178
"contributorsPerLine": 7,
125179
"projectName": "Python_and_the_Web",
126180
"projectOwner": "Python-World",

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
77

88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9-
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-)
1010
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1111

1212
![Issues](https://img.shields.io/github/issues/Python-World/Python_and_the_Web)
@@ -108,6 +108,15 @@ We now have a section for miscellaneous scripts as well.
108108
<td align="center"><a href="https://github.com/tauseefmohammed2"><img src="https://avatars2.githubusercontent.com/u/35351464?v=4" width="100px;" alt=""/><br /><sub><b>tauseefmohammed2</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=tauseefmohammed2" title="Code">💻</a></td>
109109
<td align="center"><a href="https://ameyanrd.github.io/"><img src="https://avatars1.githubusercontent.com/u/42608371?v=4" width="100px;" alt=""/><br /><sub><b>Ameya Deshpande</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=ameyanrd" title="Code">💻</a></td>
110110
<td align="center"><a href="https://github.com/nj1902"><img src="https://user-images.githubusercontent.com/56442920/94884868-4dac4480-048c-11eb-9c56-7aaf87ba3597.jpeg" width="200px;" alt=""/><br /><sub><b>Naman Jain</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=nj1902" title="Code">💻</a></td>
111+
=======
112+
<td align="center"><a href="https://aravindha1234u.github.io"><img src="https://avatars0.githubusercontent.com/u/52521300?v=4" width="100px;" alt=""/><br /><sub><b>T3cH_W1z4rD</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=Aravindha1234u" title="Code">💻</a></td>
113+
<td align="center"><a href="https://github.com/Meghana-12"><img src="https://avatars0.githubusercontent.com/u/44519203?v=4" width="100px;" alt=""/><br /><sub><b>Meghana Varanasi</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=Meghana-12" title="Code">💻</a></td>
114+
</tr>
115+
<tr>
116+
<td align="center"><a href="https://github.com/mendoza"><img src="https://avatars1.githubusercontent.com/u/30415552?v=4" width="100px;" alt=""/><br /><sub><b>David Mendoza</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=mendoza" title="Code">💻</a></td>
117+
<td align="center"><a href="https://github.com/dkarmy12"><img src="https://avatars1.githubusercontent.com/u/55491427?v=4" width="100px;" alt=""/><br /><sub><b>dkarmy12</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=dkarmy12" title="Code">💻</a></td>
118+
<td align="center"><a href="http://madhavmehndiratta.me"><img src="https://avatars3.githubusercontent.com/u/43489174?v=4" width="100px;" alt=""/><br /><sub><b>Madhav Mehndiratta</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=madhavmehndiratta" title="Code">💻</a></td>
119+
<td align="center"><a href="http://www.linkedin.com/in/yogeshwaran01"><img src="https://avatars1.githubusercontent.com/u/66836092?v=4" width="100px;" alt=""/><br /><sub><b>YOGESHWARAN R</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=yogeshwaran01" title="Code">💻</a></td>
111120
</tr>
112121
</table>
113122

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# ActivationFunctions using Custom Layers in Keras
2+
Activation functions are an important are of deep learning research .Many new activation functions are being developed ,these include *bio-inspired* activtions, *purely mathematical activation functions* including others . Despite, such advancements we usually find ourselves using RELU and LeakyRELU commonly without using/thinking about others.
3+
In the following notebooks I showcase how easy/difficult it is to port an activation function using **Custom Layers in Keras and Tensorflow!**
4+
5+
6+
Link to main notebook --> [Activations.ipynb](https://github.com/Agrover112/ActivationFunctions/blob/master/src/Activation-Functions(GELU%2CSELU%2CELU%2CLeakyReLU%2CPRELU).ipynb)
7+
8+
## Requirements
9+
Google Colab
10+
11+
### Implemented activations:
12+
13+
- LeakyReLu
14+
- ParametricReLu
15+
- Elu
16+
- SElu
17+
- GELU
18+
19+
20+
21+
### Structure
22+
```
23+
src
24+
|
25+
|-- Activations.ipynb
26+
|-- utils
27+
|-- Utils.ipynb
28+
|-- utils.py
29+
30+
references
31+
|
32+
|--Ref1
33+
|--Refn
34+
35+
```
36+
37+
### Usage
38+
```
39+
git clone https://github.com/Agrover112/ActivationFunctions.git
40+
```
41+
42+
### References
43+
- [References:D](https://github.com/Agrover112/ActivationFunctions/tree/master/references)

Scripts/Miscellaneous/Activation_Functions_from_scratch_in_Keras/src/Activation-Functions(GELU,SELU,ELU,LeakyReLU,PRELU).ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Utils","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyMYHshcegvtTBQwBygO/eoj"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"id":"_ImvYera1GfS","colab_type":"code","colab":{},"executionInfo":{"status":"ok","timestamp":1595963420315,"user_tz":-330,"elapsed":2543,"user":{"displayName":"Agrover112","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GiMJACGAX3kCfRjB2hgzdG8w9zL1lAAKbPPMz0qLA=s64","userId":"09574164879083471944"}}},"source":["import tensorflow as tf\n","import numpy as np\n","import matplotlib.pyplot as plt\n","def load_data():\n"," (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\n"," x_train = np.reshape(x_train, (x_train.shape[0], 784))/255.\n"," x_test = np.reshape(x_test, (x_test.shape[0], 784))/255.\n"," y_train = tf.keras.utils.to_categorical(y_train)\n"," y_test = tf.keras.utils.to_categorical(y_test)\n"," return (x_train, y_train), (x_test, y_test)\n","\n","def plot_random_examples(x, y, p=None):\n"," indices = np.random.choice(range(0, x.shape[0]), 10)\n"," y = np.argmax(y, axis=1)\n"," if p is None:\n"," p = y\n"," plt.figure(figsize=(10, 5))\n"," for i, index in enumerate(indices):\n"," plt.subplot(2, 5, i+1)\n"," plt.imshow(x[index].reshape((28, 28)), cmap='binary')\n"," plt.xticks([])\n"," plt.yticks([])\n"," if y[index] == p[index]:\n"," col = 'g'\n"," else:\n"," col = 'r'\n"," plt.xlabel(str(p[index]), color=col)\n"," return plt\n","\n","def plot_results(history):\n"," history = history.history\n"," plt.figure(figsize=(12, 4))\n"," epochs = len(history['val_loss'])\n"," plt.subplot(1, 2, 1)\n"," plt.plot(range(epochs), history['val_loss'], label='Val Loss')\n"," plt.plot(range(epochs), history['loss'], label='Train Loss')\n"," plt.xticks(list(range(epochs)))\n"," plt.xlabel('Epochs')\n"," plt.ylabel('Loss')\n"," plt.legend()\n"," plt.subplot(1, 2, 2)\n"," plt.plot(range(epochs), history['val_accuracy'], label='Val Acc')\n"," plt.plot(range(epochs), history['accuracy'], label='Acc')\n"," plt.xticks(list(range(epochs)))\n"," plt.xlabel('Epochs')\n"," plt.ylabel('Accuracy')\n"," plt.legend()\n"," return plt"],"execution_count":1,"outputs":[]},{"cell_type":"code","metadata":{"id":"iRwkOk0p1SPt","colab_type":"code","colab":{}},"source":[""],"execution_count":null,"outputs":[]}]}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import tensorflow as tf
2+
import numpy as np
3+
import matplotlib.pyplot as plt # loading dependencies
4+
5+
def load_data(): # method for loading mnist dataset
6+
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
7+
x_train = np.reshape(x_train, (x_train.shape[0], 784))/255.
8+
x_test = np.reshape(x_test, (x_test.shape[0], 784))/255. # normalization of images
9+
y_train = tf.keras.utils.to_categorical(y_train) # converting to categorical fearures
10+
y_test = tf.keras.utils.to_categorical(y_test)
11+
return (x_train, y_train), (x_test, y_test)
12+
13+
def plot_random_examples(x, y, p=None): # function that samples randomly and plots images
14+
indices = np.random.choice(range(0, x.shape[0]), 10)
15+
y = np.argmax(y, axis=1)
16+
if p is None:
17+
p = y
18+
plt.figure(figsize=(10, 5))
19+
for i, index in enumerate(indices):
20+
plt.subplot(2, 5, i+1)
21+
plt.imshow(x[index].reshape((28, 28)), cmap='binary')
22+
plt.xticks([])
23+
plt.yticks([])
24+
if y[index] == p[index]:
25+
col = 'g'
26+
else:
27+
col = 'r'
28+
plt.xlabel(str(p[index]), color=col)
29+
return plt
30+
31+
def plot_results(history): # function that accepts history object from keras and plots the Loss,Accuracy,Validation Accuracy
32+
history = history.history
33+
plt.figure(figsize=(12, 4))
34+
epochs = len(history['val_loss'])
35+
plt.subplot(1, 2, 1)
36+
plt.plot(range(epochs), history['val_loss'], label='Val Loss')
37+
plt.plot(range(epochs), history['loss'], label='Train Loss')
38+
plt.xticks(list(range(epochs)))
39+
plt.xlabel('Epochs')
40+
plt.ylabel('Loss')
41+
plt.legend()
42+
plt.subplot(1, 2, 2)
43+
plt.plot(range(epochs), history['val_accuracy'], label='Val Acc')
44+
plt.plot(range(epochs), history['accuracy'], label='Acc')
45+
plt.xticks(list(range(epochs)))
46+
plt.xlabel('Epochs')
47+
plt.ylabel('Accuracy')
48+
plt.legend()
49+
return plt
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# COVID19 Dashboard using Streamlit
2+
This is app built with streamlit framework to display live covid19 data across the world with help of api.covid19api.com as data source.
3+
4+
### Prerequisites
5+
* streamlit
6+
* requests
7+
* pytablewriter
8+
* datetime
9+
10+
or
11+
12+
`pip3 install requirements.txt`
13+
14+
### How to run the script
15+
16+
`streamlit run covid19.py`
17+
18+
Visit Local URL: http://localhost:8501 to view the app.
19+
20+
### Screenshot
21+
![Screenshot](https://i.imgur.com/zJQhxTq.png)
22+
23+
## *Author Name*
24+
[Aravindha Hariharan M](https://aravindha1234u.github.io)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import streamlit as st
2+
import requests
3+
from pytablewriter import MarkdownTableWriter
4+
from datetime import datetime
5+
6+
response = requests.get('https://api.covid19api.com/summary') # Get Request to pull down data from Covid19 data source
7+
data = response.json()
8+
9+
st.markdown(MarkdownTableWriter(
10+
table_name="Covid19 Worldwide Data",
11+
headers=["Total Confirmed", "Total Recovered", "Total Deaths"],
12+
value_matrix=[[data['Global']['TotalConfirmed'], data['Global']['TotalRecovered'], data['Global']['TotalDeaths']]],
13+
)) # To form a Table for Live World data stat
14+
15+
st.write("")
16+
st.write("**Last Updated Time: {} **".format(datetime.strptime(data['Date'][:-1],"%Y-%m-%dT%H:%M:%S").strftime("%b %d %Y %H:%M:%S")))
17+
# To Display the date & time of Last updated data of Covid19 Reports
18+
19+
st.write("")
20+
country = st.text_input("Enter Country Name:","") # Input to filter according to country name
21+
22+
table_data = [ [i['Country'],i['TotalConfirmed'],i['TotalRecovered'],i['TotalDeaths']] for i in data['Countries'] ]
23+
24+
if country != "":
25+
table_data=[]
26+
table_data = [ [i['Country'],i['TotalConfirmed'],i['TotalRecovered'],i['TotalDeaths']] for i in data['Countries'] if i['Country'].lower() == country.lower() ]
27+
# If country name is not entered then display all Country
28+
29+
st.markdown(MarkdownTableWriter(
30+
table_name="CountryWise Data",
31+
headers=["Country Name", "Confirmed", "Recovered", "Deaths"],
32+
value_matrix=table_data,
33+
)) # table to display countrywise count reports
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
streamlit
2+
requests
3+
pytablewriter
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Instagram Analyzer
2+
3+
This Scripts analyze the Instagram user data like Followers, Followings and Posts with Matplotlib
4+
bar charts.
5+
6+
## Prerequisites
7+
8+
Install the required packages
9+
10+
`pip install -r requirements.txt`
11+
12+
## How to use this script?
13+
14+
1.Make a text file of list of Instagram username. For example
15+
`user.txt` contains
16+
17+
```
18+
github
19+
pubg
20+
facebook
21+
iplt20
22+
chennaiipl
23+
google
24+
```
25+
26+
2.Run the script
27+
28+
```python instagram_analyzer.py user.txt```
29+
30+
## Screenshot
31+
![screenshot](sample.png)
32+
## Author
33+
34+
[YOGESHWARAN R]("https://github.com/yogeshwaran01/)

0 commit comments

Comments
 (0)