Skip to content

Instantly share code, notes, and snippets.

View Adityanagraj's full-sized avatar
:octocat:
I may be slow to respond but i will respond for sure

Aditya N Adityanagraj

:octocat:
I may be slow to respond but i will respond for sure
View GitHub Profile
2-6
import numpy as np
x=list(map(int,input().split(',')))
y=list(map(int,input().split(',')))
data1 = x#[3, 5, 5, 5, 8, 11, 11, 11, 13]
data2 = y#[ 3, 5, 5, 5, 8, 11, 11, 11, 20 ]
mean1 = np.mean(data1)
mean2 = np.mean(data2)
from diagrams import Cluster,Diagram
from diagrams.gcp.network import Armor as AR
from diagrams.gcp.network import LoadBalancing as LB
from diagrams.gcp.compute import ComputeEngine as CE
from diagrams.gcp.database import SQL as SQL
from diagrams.gcp.compute import KubernetesEngine as GKE
from diagrams.k8s.compute import Pod as Pod
from diagrams.gcp.storage import Storage as GCS
from diagrams.gcp.network import VirtualPrivateCloud as VPC
@Adityanagraj
Adityanagraj / Gitlab 11
Created August 21, 2022 08:11
this gist consists of gitlab installation in k8 cluster
gitlabUrl: <your gitlab URL>
runnerRegistrationToken: <your runner secret>
rbac:
create: True
clusterWideAccess: true
# runners:
# image: ubuntu:18.04
# privileged: true
runners:
privileged: true
@Adityanagraj
Adityanagraj / .gitlab-ci.yml
Created August 15, 2022 14:45
part 2 of gitlab pipeline
stages:
- test
publish:
image: docker:20.10.12-git
stage: test
services:
- docker:20.10.12-dind
tags:
- docker
%-------------------------
% Resume in Latex
% Author : Sourabh Bajaj
% License : MIT
%------------------------
\documentclass[letterpaper,11pt]{article}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
input, target = val_ds[10]
predict_single(input, target, model)
def predict_single(input, target, model):
inputs = input.unsqueeze(0)
predictions = model(inputs) # fill this #model(inputs)
prediction = predictions[0].detach()
print("Input:", input)
print("Target:", target)
print("Prediction:", prediction)
model = FishModel()
epochs = 1000
lr = 1e-2
history1 = fit(epochs, lr, model, train_loader, val_loader)
def evaluate(model, val_loader):
outputs = [model.validation_step(batch) for batch in val_loader]
return model.validation_epoch_end(outputs)
def fit(epochs, lr, model, train_loader, val_loader, opt_func=torch.optim.SGD):
history = []
optimizer = opt_func(model.parameters(), lr)
for epoch in range(epochs):
# Training Phase
for batch in train_loader:
model = FishModel()