Skip to content

Instantly share code, notes, and snippets.

View david1542's full-sized avatar
🎯
Focusing

Dudu Lasry david1542

🎯
Focusing
View GitHub Profile
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)
@david1542
david1542 / gist:a0831761de35e7805cd9c99225076cb9
Last active February 28, 2021 19:35
Section 7 - DL HW 1
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']}
{
"ADS": {
"transformOptions": {
"transformers": [
{
"transformerType": "ParserTransformer",
"input": {
"typeName": "FileParserTransformerInput",
"order": 0,
"fileParsers": [
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';
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;
from djongo import models
from django import forms
userStatusEnum = (
('pending', 'pending'),
('active', 'active'),
('removed', 'removed'),
)
userTypeEnum = (
('buyer', 'buyer'),