Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class Net(nn.Module): | |
""" | |
Image2Vector CNN which takes image of dimension (28x28x3) and return column vector length 64 | |
""" | |
def sub_block(self, in_channels, out_channels=64, kernel_size=3): | |
block = torch.nn.Sequential( | |
torch.nn.Conv2d(kernel_size=kernel_size, in_channels=in_channels, out_channels=out_channels, padding=1), | |
torch.nn.BatchNorm2d(out_channels), | |
torch.nn.ReLU(), | |
torch.nn.MaxPool2d(kernel_size=2) |
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
Sustainable Industry: Rinse Over Run competition. Scored 58 rank out of 1200+ participants. link: https://www.drivendata.org/competitions/56/predict-cleaning-time-series/ |
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
#include <stdio.h> | |
using namespace std; | |
double get_sum(int m, int n, double **array) | |
{ | |
double sum; | |
for (int i = 0; i < n; i++) | |
{ | |
for (int j = 0; j < m; j++) | |
{ |
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 torch | |
from torch import nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
class UNet(nn.Module): | |
def contracting_block(self, in_channels, out_channels, kernel_size=3): | |
block = torch.nn.Sequential( | |
torch.nn.Conv2d(kernel_size=kernel_size, in_channels=in_channels, out_channels=out_channels), | |
torch.nn.ReLU(), |
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 math | |
def euclidean_dist(p1, p2): | |
return math.sqrt(math.pow(p1[0] - p2[0], 2) + math.pow(p1[1] - p2[1], 2)) | |
def allocate_class(x, means): | |
classes = {} | |
for clas in means: | |
classes[clas] = [] | |
for idx, point in enumerate(x): | |
min_dist = None |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
This is the code for QR factorization using Householder Transformation. | |
This program is made in python 3.5.3 but will be compatible to any python 3.4+ version | |
We used numpy library for matrix manipulation. | |
Install numpy using ** pip3 install numpy ** command on terminal. | |
To run the code write ** python3 qr_householder.py ** on terminal | |
User has to give dimension of the matrix as input in space separated format and matrix will be generated randomly. | |
QR factorization can be done for both square and non-square matrices and hence the code supports both. | |
""" | |
import numpy as np |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
typedef struct Translation Translation; | |
typedef struct State State; | |
typedef struct Translation | |
{ | |
struct State *nextState; | |
char input; |
NewerOlder