Skip to content

Instantly share code, notes, and snippets.

View vaibhavkumar049's full-sized avatar
🐍
Python

Vaibhav Kumar Chaudhary vaibhavkumar049

🐍
Python
View GitHub Profile
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-xs-12">
<h1 class"text-center">Vaibhav Kumar Chaudhary</h1>
<h2 class="text-center">the guy who wrote this page</h2>
<div class="thumbnail">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTIvcpON6b8VUSaslbX7HEki3qBED9RRtuKpXs1svDZS2gjTG9lnA" alt="a handsome guy">
@vaibhavkumar049
vaibhavkumar049 / pure_html_css_modal.css
Created April 30, 2019 15:21 — forked from calebporzio/pure_html_css_modal.css
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
import torch
import numpy as np
import matplotlib.pyplot as plt
x = torch.ones(3, 2)
print(x)
x = torch.zeros(3, 2)
print(x)
x = torch.rand(3, 2)
print(x)
a = np.random.randn(5)
print(a)
a_pt = torch.from_numpy(a)
print(type(a), type(a_pt))
print(a_pt)
a = torch.ones(3, 2, device=cuda0)
b = torch.ones(3, 2, device=cuda0)
c = a + b
print(c)
y = x + 5
z = y*y + 1
t = torch.sum(z)
t.backward()
print(x.grad)
x = torch.ones([3, 2], requires_grad=True)
y = x + 5
r = 1/(1 + torch.exp(-y))
print(r)
s = torch.sum(r)
s.backward()
print(x.grad)
x = torch.ones([3, 2], requires_grad=True)
y = x + 5
r = 1/(1 + torch.exp(-y))
print(r)
s = torch.sum(r)
s.backward()
print(x.grad)
x = torch.ones([3, 2], requires_grad=True)
y = x + 5
r = 1/(1 + torch.exp(-y))
a = torch.ones([3, 2])
r.backward(a)
print(x.grad)