Skip to content

Instantly share code, notes, and snippets.

View sujit25's full-sized avatar

Sujit Nalawade sujit25

View GitHub Profile
@mlblogger
mlblogger / tradingenv.py
Created January 19, 2023 11:27
Simple trading environment using openai gym
import gym
from gym.envs.registration import register
from gym import error, spaces, utils
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader.data as web
import arrow
import random
import sys
@raulqf
raulqf / Install_OpenCV4_CUDA11_CUDNN8.md
Last active March 22, 2024 07:15
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 22.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 22.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active March 22, 2024 18:05
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@cedrickchee
cedrickchee / create_kg_dog_breed_ident_sub.py
Created January 18, 2018 14:33
Create Kaggle Dog Breed Identification Challenge submission.csv file
# Step - Submit Predictions
# We have finished training and ready to run predictions on the test set.
log_test_preds = learn.predict(is_test=True)
# Convert log predictions to just probabilities (predictions).
test_preds = np.exp(log_test_preds)
# Create the submission file using the probabilities
# Get a list of image file names from the test data loader
im_fnames = data.test_dl.dataset.fnames
@krishvishal
krishvishal / plot_kernels.py
Last active October 22, 2022 18:27
Visualize weights in pytorch
from model import Net
from trainer import Trainer
import torch
from torch import nn
from matplotlib import pyplot as plt
model = Net()
ckpt = torch.load('path_to_checkpoint')
model.load_state_dict(ckpt['state_dict'])
filter = model.conv1.weight.data.numpy()
@karpathy
karpathy / min-char-rnn.py
Last active March 27, 2024 21:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 28, 2024 08:13
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@jaseemabid
jaseemabid / git tutorials.md
Last active March 24, 2024 00:07 — forked from netroy/git tutorials.md
Awesome git tutorials I am finding here and there