This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import required Libraries | |
import gym | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import matplotlib.pyplot as plt | |
# Create the Actor Network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import required libararies | |
import gym | |
import matplotlib.pyplot as plt | |
import random | |
import numpy as np | |
from IPython.display import clear_output | |
#Create an instance of the the Taxi-v3 environment | |
env= gym.make("Taxi-v3").env | |
# Creating the q-table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fibonaci of 5 using recursion | |
def calc_fibonaci(n): | |
if n<=1: | |
return n | |
return calc_fibonaci(n-1) + calc_fibonaci(n-2) | |
print(calc_fibonaci(6)) | |
# Memoization | |
def calc_fibonaci(n): | |
cache=[-1 for x in range(n+1)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libararies | |
import numpy as np | |
import pandas as pd | |
import os | |
import torch_geometric.transforms as T | |
from torch_geometric.datasets import Planetoid | |
import matplotlib.pyplot as plt | |
import torch | |
import torch.nn.functional as F |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the necessary packages | |
from scipy.spatial import distance as dist | |
import numpy as np | |
import imutils | |
from imutils import contours | |
from imutils import perspective | |
import cv2 | |
# detect aruco marker | |
def findArucoMarkers(img, markerSize = 6, totalMarkers=100, draw=True): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing libraries | |
from PIL import Image | |
import numpy as np | |
import cv2 | |
import math | |
# setting variables | |
tracking_people={} | |
person_id=0 | |
frame_num = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
frame_count=0 | |
# Open the Video | |
video = cv2. VideoCapture('people_motion.avi') | |
# read the fiurst frame of the video as the initial background image | |
ret, Prev_frame= video.read() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Titanic Data Analysis" | |
output: html_document | |
author: Authored by Renu | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
# Data Analysis of Titanic dataset using R Markdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import required libraries | |
import tensorflow as tf | |
from keras.datasets import mnist | |
#Creating the MNIST Dataset | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() | |
x_train, x_test= x_train/255.0, x_test/255.0 | |
x_train=x_train[...,tf.newaxis].astype('float32') | |
x_test=x_test[...,tf.newaxis].astype('float32') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import required libraries | |
import tensorflow as tf | |
from keras.datasets import mnist | |
#Creating the MNIST Dataset | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() | |
x_train, x_test= x_train/255.0, x_test/255.0 | |
x_train=x_train[...,tf.newaxis].astype('float32') | |
x_test=x_test[...,tf.newaxis].astype('float32') |
NewerOlder