This file contains hidden or 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
| name: Master CI/CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| primary: | |
| runs-on: ubuntu-latest | |
This file contains hidden or 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
| service: sample-github-actions | |
| provider: | |
| name: aws | |
| runtime: nodejs12.x | |
| stage: dev | |
| region: us-east-1 | |
| functions: | |
| app: |
This file contains hidden or 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
| var express = require('express'); | |
| var app = express(); | |
| var serverlessHttp = require('serverless-http') | |
| app.get("/", function(req, res){ | |
| res.send("HELLO WORLD"); | |
| }) | |
| module.exports.handler = serverlessHttp(app) |
This file contains hidden or 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 numpy as np | |
| input1 = [0,0,1,1] | |
| input2 = [1,0,1,0] | |
| truth = [0,1,0,1] | |
| weight1 = 0 | |
| weight2 = -1 | |
| bias = 0 | |
| def perceptron(input1, input2): |
This file contains hidden or 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 numpy as np | |
| input1 = [0,0,1,1] | |
| input2 = [1,0,1,0] | |
| truth = [0,0,1,0] | |
| weight1 = 1 | |
| weight2 = 1 | |
| bias = -2 | |
| def perceptron(input1, input2): |
This file contains hidden or 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 lis_dp(X): | |
| if not X: | |
| return 0 | |
| memo = [1] * len(X) | |
| for i in range(1,len(X)): | |
| for j in range(i): | |
| if X[j] < X[i]: | |
| memo[i] = max(memo[i],memo[j]+1) | |
| return max(memo) |
This file contains hidden or 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 lcs(X,Y, m, n): | |
| if m < 0 or n < 0: | |
| return 0 | |
| elif X[m] == Y[n]: | |
| return 1 + lcs(X,Y, m-1,n-1) | |
| else: | |
| return max(lcs(X,Y,m-1,n),lcs(X,Y,m,n-1)) |
This file contains hidden or 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 maxCount(arr): | |
| prevMax = 0 | |
| currMax = 0 | |
| for ar in arr: | |
| temp = currMax | |
| currMax = max(prevMax+ar, currMax) | |
| prevMax = temp | |
| return currMax |
This file contains hidden or 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
| { | |
| "author": "Vigneash Sundararajan", | |
| "name": "sample", | |
| "version":"0.0.1" | |
| } |
This file contains hidden or 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 | |
| #Creates two tensor objects | |
| #Where X is a simple 1 Dimentional Tensor | |
| #Y is a vector | |
| X = torch.tensor(1.0) | |
| Y = torch.tensor([1.0,2.0]) | |
| #Alternatively we can also create a tensor from data like this | |
| Z = torch.tensor([[1.0,2.0,3.0], | |
| [2.0,3.0,4.0], | |
| [3.0,4.0,5.0]]) |
NewerOlder