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
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) |
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 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 | |
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
gitlabUrl: <your gitlab URL> | |
runnerRegistrationToken: <your runner secret> | |
rbac: | |
create: True | |
clusterWideAccess: true | |
# runners: | |
# image: ubuntu:18.04 | |
# privileged: true | |
runners: | |
privileged: true |
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
stages: | |
- test | |
publish: | |
image: docker:20.10.12-git | |
stage: test | |
services: | |
- docker:20.10.12-dind | |
tags: | |
- docker |
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
%------------------------- | |
% Resume in Latex | |
% Author : Sourabh Bajaj | |
% License : MIT | |
%------------------------ | |
\documentclass[letterpaper,11pt]{article} | |
\usepackage{latexsym} | |
\usepackage[empty]{fullpage} |
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
input, target = val_ds[10] | |
predict_single(input, target, model) |
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
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) |
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
model = FishModel() | |
epochs = 1000 | |
lr = 1e-2 | |
history1 = fit(epochs, lr, model, train_loader, val_loader) |
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
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: |
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
model = FishModel() |
NewerOlder