Skip to content

Instantly share code, notes, and snippets.

View ZolotukhinM's full-sized avatar

Mikhail Zolotukhin ZolotukhinM

View GitHub Profile
#!/usr/bin/python
import random
color = {
"BOLD": "\033[1m",
"UNDERLINE": "\033[4m",
"GREEN": "\033[92m",
"RED": "\033[91m",
"BLUE": "\033[94m",
"CLEAR": "\033[0m",
@ZolotukhinM
ZolotukhinM / nnc_deepandwide.py
Created January 22, 2021 21:22
3 Versions of DeepAndWide model: TorchScript, StaticRuntime, and NNC
import torch
import os
from timeit import default_timer as timer
class DeepAndWide(torch.nn.Module):
def __init__(self, num_features=50):
super(DeepAndWide, self).__init__()
self.mu = torch.randn(1, num_features)
self.sigma = torch.randn(1, num_features)
self.fc_w = torch.randn(1, num_features + 1)
@ZolotukhinM
ZolotukhinM / benchmark_deepandwide.py
Created November 5, 2020 17:33
DeepAndWide benchmark
import torch
import os
from timeit import default_timer as timer
class DeepAndWide(torch.nn.Module):
def __init__(self, num_features=50):
super(DeepAndWide, self).__init__()
self.mu = torch.rand(1, num_features)
self.sigma = torch.rand(1, num_features)
self.fc_w = torch.rand(1, num_features + 1)