Skip to content

Instantly share code, notes, and snippets.

Aakash N S aakashns

Block or report user

Report or block aakashns

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cifar10-superconvergence.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View learner.py
from fastai.conv_learner import ConvLearner, num_cpus, accuracy
def get_learner(arch, bs):
"""Create a FastAI learner using the given model"""
data = get_data(bs, num_cpus())
learn = ConvLearner.from_model_data(arch.cuda(), data)
learn.crit = nn.CrossEntropyLoss()
learn.metrics = [accuracy]
return learn
View basic_block.py
import torch.nn as nn
import torch.nn.functional as F
def conv_2d(ni, nf, stride=1, ks=3):
return nn.Conv2d(in_channels=ni, out_channels=nf,
kernel_size=ks, stride=stride,
padding=ks//2, bias=False)
def bn_relu_conv(ni, nf):
return nn.Sequential(nn.BatchNorm2d(ni),
View Structured Classification Test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View AsyncSettingsPage.js
import Loadable from "react-loadable";
import Loading from "./Loading";
const AsyncSettingsPage = Loadable({
loader: () => import("./SettingsPage"),
loading: Loading
});
export { AsyncSettingsPage };
View downloader.py
#!/usr/bin/python
# Note to Kagglers: This script will not run directly in Kaggle kernels. You
# need to download it and run it on your local machine.
# Downloads images from the Google Landmarks dataset using multiple threads.
# Images that already exist will not be downloaded again, so the script can
# resume a partially completed download. All images will be saved in the JPG
# format with 90% compression quality.
@aakashns
aakashns / proc_df_test.ipynb
Last active Mar 7, 2018
Test cases for enhanced proc_df
View proc_df_test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View contactForm.js
// Selectors for specific fields
const getName = data => data.name;
const getAddress = data => data.address;
const getSubscribeToNewsLetter = data => data.subscribeToNewsLetter;
// Action creators for specific fields
const setName = name => editContactForm({ name });
const setAddress = address => editContactForm({ address });
const setSubscribeToNewsletter = v =>
editContactForm({ subscribeToNewsLetter: v });
@aakashns
aakashns / ContactForm.jsx
Created Dec 5, 2017
Connecting the contactForm reducer with a React component.
View ContactForm.jsx
const ContactForm = ({ data, editData }) => (
<div>
<h4>Contact Form</h4>
<input
type="text"
value={data.name}
onChange={e => editData({ name: e.target.value })}
/>
<input
type="text"
@aakashns
aakashns / contactForm.js
Last active Dec 5, 2017
A simple reducer to manage form state in Redux
View contactForm.js
const EDIT_CONTACT_FORM = "EDIT_CONTACT_FORM";
const CLEAR_CONTACT_FORM = "CLEAR_CONTACT_FORM";
const contactForm = (state = {}, action) => {
const { type, payload } = action;
switch (type) {
case EDIT_CONTACT_FORM:
return {
...state,
...payload
You can’t perform that action at this time.