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
// | |
void AddrSpace::loadIntoFreePage(int vpn){ | |
int physicalPageNo=memoryManager->AllocPage(); | |
pageTable[vpn].physicalPage = physicalPageNo; | |
pageTable[vpn].valid = true; | |
bzero(&machine -> mainMemory[(pageTable[vpn].physicalPage) * PageSize], PageSize); | |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sun Nov 18 23:42:40 2018 | |
@author: yeaseen | |
""" | |
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
//forward differencing method for rendering curve points | |
int t=20; | |
double space=0.05; | |
double fx,fy,f1x,f2x,f3x,f1y,f2y,f3y; | |
fx=ansMat[3][0]; | |
fy=ansMat[3][1]; | |
f1x= ansMat[0][0]*pow(space,3)+ ansMat[1][0]*pow(space,2)+ansMat[2][0]*space; | |
f2x=6*ansMat[0][0]*pow(space,3)+ 2*ansMat[1][0]*pow(space,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
def AdaBoost(funcDcsn, sampleFrames, attList, \ | |
parentFrames,strtdepth, maxdepth,funcClassify,rootClass, K): | |
Y=sampleFrames.iloc[:,-1].values.tolist().copy() | |
#print(Y) | |
N=len(sampleFrames) | |
w= [1/N] * N | |
h= [] | |
z= [] | |
#print(w) |
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
for i in range(train.shape[0]): | |
v=[] | |
y=[] | |
inputNeuron = [train[i]] | |
v.append(inputNeuron) | |
y.append(inputNeuron) | |
for r in range(len(layerNeurons) -1): | |
w=weight[r] | |
matout=np.matmul(inputNeuron,w) |
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
M = np.mean(train.T, axis=1) | |
C= M - train | |
V=np.cov(C.T) | |
eigenValues, eigenVectors =eig(V) | |
k=2 | |
idx = eigenValues.argsort()[-k:][::-1] | |
eigenValues = eigenValues[idx] | |
eigenVectors = eigenVectors[:,idx] |
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 <iostream> | |
#include <fstream> | |
#include <cassert> | |
#include <iomanip> | |
#include <cmath> | |
#include <stack> | |
#include <queue> | |
#include "bitmap_image.hpp" | |
using namespace std; |
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
homogeneous_point intersect(homogeneous_point p3,homogeneous_point p2, double z){ | |
homogeneous_point ans; | |
ans.w=1; | |
ans.z=z; | |
ans.x=p2.x + ((p3.x-p2.x)/(p3.z-p2.z))*(z-p2.z); | |
ans.y=p2.y + ((p3.y-p2.y)/(p3.z-p2.z))*(z-p2.z); | |
//ans.print(); | |
return ans; | |
} |
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
!apt-get install -y -qq software-properties-common module-init-tools | |
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null | |
!apt-get update -qq 2>&1 > /dev/null | |
!apt-get -y install -qq google-drive-ocamlfuse fuse | |
from google.colab import auth | |
from oauth2client.client import GoogleCredentials |
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 <iostream> | |
#include <cmath> | |
using namespace std; | |
struct Data{ | |
double key; | |
double x; | |
double y; |
OlderNewer