Skip to content

Instantly share code, notes, and snippets.

View Saransh-cpp's full-sized avatar

Saransh Chopra Saransh-cpp

View GitHub Profile
@Saransh-cpp
Saransh-cpp / Snowmass2022_JuliaHEP.md
Created August 2, 2022 19:06 — forked from Moelf/Snowmass2022_JuliaHEP.md
Snowmass2022 JuliaHEP

more links:

@Saransh-cpp
Saransh-cpp / download_yt_songs.py
Created June 10, 2022 07:37
Download multiple songs from YouTube in one go
import googleapiclient.discovery
from creds import API_KEY
import youtube_dl
import os
# API information
api_service_name = "youtube"
api_version = "v3"
DEVELOPER_KEY = API_KEY
def predict(self, x):
"""
Predicts the y values based on the training data.
"""
prediction = []
for single_data in x:
prediction.append(
1 if self.sigmoid(np.dot(single_data, self.W) + self.b) > 0.5 else 0
)
def fit(self):
"""
Maths involved -
z = w.T * x + b
y_predicted = a = sigmoid(z)
dw += (1 / m) * x * dz
db += dz
Gradient descent -
w = w - α * dw
b = b - α * db
import numpy as np
from sklearn.datasets import load_digits
class LogisticRegression:
"""
Logistic Regression using neural network.
Parameters
==========
X : np.ndarray
@Saransh-cpp
Saransh-cpp / sigmoid.py
Created October 16, 2021 20:08
Sigmoid function
def sigmoid(self, z):
"""
Returns sigmoid value.
"""
return 1 / (1 + np.exp(-z))
@Saransh-cpp
Saransh-cpp / FinalGSoC2021Report.md
Created August 21, 2021 16:06
Final report for Google Summer of Code 2021 (Organization - NumFOCUS, Sub-organization - PyBaMM)

Final Report for Google Summer of Code 2021

Python Battery Mathematical Modelling (PyBaMM), NumFOCUS


An Automated Twitter Bot to run PyBaMM Simulations


Details

Name: Saransh Chopra

@Saransh-cpp
Saransh-cpp / DraftGSoC21Report.md
Last active August 21, 2021 16:06
Draft Report for Google Summer of Code 2021 - PyBaMM, NumFOCUS

Final Report for Google Summer of Code 2021

Python Battery Mathematical Modelling (PyBaMM), NumFOCUS


An Automated Twitter Bot to run PyBaMM Simulations


Details

Name: Saransh Chopra

@Saransh-cpp
Saransh-cpp / 4d.py
Last active July 31, 2021 07:39
Mathematical visualization project, made with manim
from manim import *
class Intro(Scene):
config.background_color = YELLOW_C
def construct(self):
g = NumberPlane()
self.add_sound(