View Section 8 - DL HW 1
This file contains 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 json | |
class Network(nn.Module): | |
def __init__(self, image_width, image_height): | |
super().__init__() | |
self.image_width = image_width | |
self.image_height = image_height | |
self.conv1 = nn.Conv2d(3, 32, 3) | |
self.conv2 = nn.Conv2d(32, 16, 3) |
View gist:a0831761de35e7805cd9c99225076cb9
This file contains 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 json | |
def evaluate_models(models_to_evaluate): | |
data_dir = polit_path | |
image_datasets = {x: datasets.ImageFolder(os.path.join(data_dir, x), | |
data_transforms[x]) | |
for x in ['train', 'val']} | |
dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=16, | |
shuffle=True, num_workers=4) | |
for x in ['train', 'val']} |
View dtr-put-mapping
This file contains 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
{ | |
"ADS": { | |
"transformOptions": { | |
"transformers": [ | |
{ | |
"transformerType": "ParserTransformer", | |
"input": { | |
"typeName": "FileParserTransformerInput", | |
"order": 0, | |
"fileParsers": [ |
View dropdown.js
This file contains 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 React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import { Button } from 'reactstrap'; | |
import styled from 'styled-components'; | |
import cloneDeep from 'lodash.clonedeep' | |
import { withBus } from 'react-bus'; | |
import { extractDeepValue } from '../../utils'; | |
import { | |
FETCH_COLLECTION | |
} from '../../actions'; |
View jsftp example
This file contains 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
function fetchFiles(path) { | |
return new Promise(function(resolve, reject) { | |
// Fetch started. Listing all files from the user specific directory. | |
ftp.ls(path, function(err, res) { | |
if(err || res.length === 0) return reject(); | |
// Close the ftp connection | |
ftp.destroy(); | |
// Iterating files list | |
async.mapSeries(res, function(file, callback) { | |
let buffer = false; |
View gist:6f783795ed9b9fa43bfc0177c7ab5504
This file contains 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
from djongo import models | |
from django import forms | |
userStatusEnum = ( | |
('pending', 'pending'), | |
('active', 'active'), | |
('removed', 'removed'), | |
) | |
userTypeEnum = ( | |
('buyer', 'buyer'), |