9/13/2018
cd - change directory (automatically goes to home directory if no directory given)
~ - the home directory
cd .. - changes directory to the current directory's parent
pwd - prints the directory you are working in
mkdir - make directory
rmdir - remove directory
rm - remove a file
touch - creates an empty file
ls - list all files in a directory
ls -l - list all files in a long listing format
ls --help - gives help and information for the list command
ls .. - lists all files in the current directory's parent
ls -CFx /usr/bin - lists all commands
man - gives information on commands
whoami - checks who the user is
find . -name - finds a file in the current directory based on its name ("_____*" or "*_____" to search for the name before or after the asterisk)
"ls /home/cms" + Tab changed to "ls /home/cms-opendata/"
"whoami" prints "cms-opendata"
"echo ~" prints /home/cms-opendata
"ls ~" lists all files in the home directory
"cd ~" takes you to the home directory
"." always refers to the current directory
".." refers to the directory on the next level up
http://ispy-webgl.web.cern.ch/ispy-webgl/#
Website that lets you look at simulations of certain experiments. (Will be used later in class.)
9/18/2018
Created an emacs document containing this:
#!/bin/tcsh
# here we can put some comments
# this is a trivial script but can serve as an example
# a script can take inputs. These are assigned variable names $1, $2 etc
# based on their position
# here we create an environmental variable ARG and assign to it the value of the first input
set ARG=$1
# here as a bug statement we echo out the value to the screen
echo $ARG
# here we have it look for all the files in / and its subdirectories that
# contain somewhere in the file name the string we inputted
find / -name "*$ARG*" -print
9/20/2018
Guest speaker today
Maria Riaz
Software Engineer, Ph.D
Works for Google, Counter Abuse Technology
Computing and Data Science:
- Fundamental Question- what can be efficiently automated
- Data use growing exponentially, 40 times what it was in 2010 by 2019
- Machine Learning- teaching computers to recognize patterns
- Over 600 companies working with big data/computing and data science
- Enabling factors
- More data
- Networking infrastructure
- Faster computing resources
- Deep learning
- Advanced algorithms
- Storage
- Machine Learning Algorithms:
- Regression/Classification (ex. decision tree)
- Advanced Algorithms:
- Deep Learning (Neural Networks)
- Deep Neural Networks
- Classification & Labelling
- Hierarchical Learning
- Links: http://cs.stanford.edu/people/karpathy/convnet(i or j)s/demo/cifar10.html
- Applications:
- Image Labeling
- Start with labeled pairs (Xi, Yi)
- Success: predict new examples
- Computer Vision
- Link
- Voice Recognition
- Link
- Cognitive Computing
- Visual Search
- Geo-Location
- Link
- Natural Language Processing
- Link
- Classification
- Weather Prediction
- Open Challenges in Data Science
- Technological limitations
- Gap between expectation and reality
- Social concerns
- Political and regulatory factors
- Shortage of talent
- Immaturity of the market
- Developing Insights From Data
- "What am I measuring?"
- "Are observed patterns and relations in the data significant?"
- "Are they meaningful?"
- "What are my hypotheses?"
- "What are the characteristics of my data?"
- "What algorithms/methodologies are useful for analyzing it?"
- Security and Privacy
- Security:
- Confidentiality
- Integrity
- Availability
- ID & Authentication
- Accountability
- Privacy:
- Principles and practices (Notice, Choice, Control, Redress)
- Regulations (Storage & Retention, Takeout & Wipeout)
9/25/2018
Units:
Mass- GeV |E|
time- 1/E
distance- 1/E
C, h-bar = 1
(mc^2)^2 = E^2 - |P|^2 <-- moving energy
^
|
rest energy
Briet Wigner peaks/dist
m(proton)= 940 MeV (almost 1 GeV)
m(higgs boson) = 125 GeV
histogram peaks at 125 GeV
histogram shows data other than 125 GeV due to uncertainty principle
Quantum Mechanics
rate of events is proportional to 1/((E-M)^2 + (width of a particle)/2)
change in energy = h-bar/change in time
rate of events histogram measures how long two particles will stick together while interacting
9/27/2018
. or ./ - current directory
.. or ../ - one directory up
./ - executes a script (once you have executable permissions , computer does not need tcsh, knows what to do)
tcsh./ - executes a script
"Deepfakes: Photorealistic faceswaps using deep learning"
- Deepfakes is a method for generating realistic faceswap images/videos
- A deepfake is a faceswap produced by this method
- Algorithm
1) Getting datasets
- NN's work by learning data, so we need datasets
- Can't feed regular pictures, too much noise
- Use the HOG approach: Examine each pixel, compare to surrounding pixels; Draw gradient vector from light to dark areas; Histogram of oriented gradients for each sector
- Patterns emerge that can be used to identify faces
- Used Bulat's Pytorch HOG
2) Training the neural network
- Using an autoencoder, a type of convolutional NN (CNN)
- Able to convert a complex input to and from a compressed ("latent") form
- Consists of two parts (Encoder(to compress) and Decoder(to decompress))
- Original Input > Encoder > Compressed representation > Decoder > Reconstructed input
- Autoencoders used for denoising
- To add effective diversity to our training set, we do not train directly on original data
- We train on distorted data, which is randomly warped, translated, zoomed, blurred, flipped
- Autoencoders become highly resistant to learning noise
3) Conversion
Social Impact
- Picked up a lot of media traction, much of it negative
- Has constructive uses, but also destructive
- Speculation about potential uses
10/2/2018
Began using C++
First Program, main.cpp:
#include <iostream> //includes the pre-existing file that enables input-output streams
using namespace std; //uses the standard namespace, std, whenever possible (prevents errors)
int main() { //begins execution of the program, defines the return value for the program as an integer
cout <<"Hello World!" << endl; //Print hello world to screen followed by end line (endl)
return 0; //Exit the program
}
using the commands "g++ main.cpp" and "./a.out" produces the output below:
Hello World!
Output using the command "find /usr/include/c++ -name "4*""
The command "g++ -dumpspecs" shows that the CERN virtual machine uses version 4.7.2 of C++
Additional header files and commands:
New program, variables.cpp:
#include <iostream>
using namespace std;
int main() {
cout << "hello world" << endl;. //prints "hello world"
int i=2; //sets the integer named "i" equal to 2
cout << "i = " <<i<<endl; //prints the value of i
double a=3.3; //sets the number value of the double, a, as 3.3
cout << "a = " <<a<<endl; //prints the value of a
int j = a*i; //declares j as an integer value equal to the value of "a" multiplied by the value of "i", removing the decimal in the process
cout << "a*i = "<<j<<endl; //prints the value of j as 6
return 0;
}
using the commands "g++ variables.cpp" and "./a.out" produces the output below:
hello world
i = 2
a = 3.3
a*i = 6
New program, increment.cpp:
#include <iostream>
using namespace std;
int main() {
int n=10;
cout << "n is "<<n<<endl;
n--; //decrements n by 1 (n-1)
cout<<"n is now "<<n<<endl;
n++; //increments n by 1 (n+1)
cout<<"n is now "<<n<<endl;
return 0;
}
using the commands "g++ increment.cpp" and "./a.out" produces the output below:
n is 10
n is now 9
n is now 10
New program, booleantest.cpp:
#include <iostream>
using namespace std;
int main() {
bool prop; //sets a boolean test for the prop variable
prop = (5>1); //prop is representing the statement (5>1)
cout<<"prop is "<<prop<<endl; //will return 1 because the statement (5>1) is true
prop = (1>5); //prop now represents the statement (1>5)
cout<<"prop is "<<prop<<endl; //will return 0 because the statement (1>5) is false
prop = (1 != 5); // prop now represents the statement (1 != 5), or 1 does not equal 5
cout << "prop is " <<prop<<endl; //will return 1
return 0;
}
using the commands "g++ booleantest.cpp" and "./a.out" produces the output below:
prop is 1
prop is 0
prop is 1
New program, loopstest.cpp:
#include <iostream>
using namespace std;
int main() {
int n=10;
while(n>0) { //the loop while run while the value of n is greater than 0
cout<<"n is "<<n<<endl; //prints the current value of n
n--; //decrements n, which will eventually end the loop
}
return 0;
}
using the commands "g++ loopstest.cpp" and "./a.out" produces the output below:
n is 10
n is 9
n is 8
n is 7
n is 6
n is 5
n is 4
n is 3
n is 2
n is 1
10/4/2018
Particle interactions with matter
Computing:
New program, forloopstest.cpp:
#include <iostream>
using namespace std;
int main() {
// when we declare a for loop, we also initialize the loop variable,
// specify the exit condition, and tell the program how to modify the
// loop variable at the end of each loop
for (int n=10; n>0; n--) { /*"int n=10" declares the variable n, "n>0" is the test condition to continue the loop, "n--" decrements\
the loop each time*/
cout<<"n is "<<n<<endl;//prints value of n
}
// in a for loop, the loop variable (in this case, 'n') only exists in
// the loop. we are not able to call 'n' from out here
// uncomment the following line and see for yourself
// cout<<"n outside the loop: "<<n;
return 0;
}
using the commands "g++ forloopstest.cpp" and "./a.out" produces the output below:
n is 10
n is 9
n is 8
n is 7
n is 6
n is 5
n is 4
n is 3
n is 2
n is 1
Rewriting while loops as for loops:
Initial code-
#include <iostream>
using namespace std;
int main() {
int n=0, m=0;
while(n<10) {
// this is the slow (or outer) loop
cout << "n is " << n << ": ";
m=0;
while(m<=n) {
// this is the fast (or inner) loop
// in this loop, the slow loop variable (n) is a constant
// this loop must run to completion before the slow loop
// can progress (during every iteration of the slow loop!)
cout << m;
m++;
}
// now the fast loop has finished and the slow loop can
// continue with the current iteration
cout << endl;
n++;
}
return 0 ;
}
Output:
n is 0: 0
n is 1: 01
n is 2: 012
n is 3: 0123
n is 4: 01234
n is 5: 012345
n is 6: 0123456
n is 7: 01234567
n is 8: 012345678
n is 9: 0123456789
New code with for loops-
#include <iostream>
using namespace std;
int main() {
int n=0, m=0;
for(int n=0;n<10;n++) {
// this is the slow (or outer) loop
cout << "n is " << n << ": ";
for(int m=0;m<=n;m++) {
// this is the fast (or inner) loop
// in this loop, the slow loop variable (n) is a constant
// this loop must run to completion before the slow loop
// can progress (during every iteration of the slow loop!)
cout << m;
}
// now the fast loop has finished and the slow loop can
// continue with the current iteration
cout << endl;
}
return 0 ;
}
Output:
n is 0: 0
n is 1: 01
n is 2: 012
n is 3: 0123
n is 4: 01234
n is 5: 012345
n is 6: 0123456
n is 7: 01234567
n is 8: 012345678
n is 9: 0123456789
10/16/2018
New code for logic testing, logic1.cpp-
#include <iostream>
using namespace std;
int main() {
int n = 10; //initializes n as the integer 10
while (n>=10) { //loops while n is greater than or equal to 10
if(n>5) { //checks the value of n, runs the following line of code if its greater than 5
cout<<"n is "<<n<<endl;
}
else { //runs if the condition n>5 is not satisfied
cout<<"n = "<<n<<endl;
n--; //decrements n
}
return 0;
}
}
Output:
n is 10
New code for memory and variables, pointers1.cpp-
#include <iostream>
using namespace std;
int main() {
int i = 10;
cout << "The memory address of i is " << &i << "\n"; //prints where i is stored in memory
cout << "The data stored at memory address " << &i << " is " << i << "\n"; //prints the value of i and where it is stored
int* p = &i; //sets p equal to the value stored in memory as i
cout << "The value of p is " << p << "\n"; //prints the location in memory
cout << "We say that p 'points at' the memory location referenced by address " << p << "\n"; //p references this location
cout << "The data stored at memory address " << p << " is " << *p << "\n"; //prints the value stored at p
return 0;
}
Output:
The memory address of i is 0x7ffc8d9b2894
The data stored at memory address 0x7ffc8d9b2894 is 10
The value of p is 0x7ffc8d9b2894
We say that p 'points at' the memory location referenced by address 0x7ffc8d9b2894
The data stored at memory address 0x7ffc8d9b2894 is 10
pointerprogram1.cpp-
#include <iostream>
using namespace std;
int main(){
int i = 10; //sets i equal to 10
int j = i; //sets j equal to 10, the current value of i
cout << "i= " << i << " and j= " << j << "\n";
i=5; //sets i equal to 5, j still 10
cout << "i= " << i << " and j= " << j << "\n";
j=1; //sets j equal to 1
cout << "i= " << i << " and j= " << j << "\n";
return 0;
}
Output:
i= 10 and j= 10
i= 5 and j= 10
i= 5 and j= 1
pointerprogram2.cpp-
#include <iostream>
using namespace std;
int main(){
int i = 10; //sets i equal to 10
int* p = &i; //p now references the same location in memory as i
cout << "i= " << i << " and *p= " << *p << "\n";
i=5; //i equals 5, p now equals 5 as well
cout << "i= " << i << " and *p= " << *p << "\n";
*p=1; //p equals 1, i now equals 1 as well
cout << "i= " << i << " and *p= " << *p << "\n";
return 0;
}
Output:
i= 10 and *p= 10
i= 5 and *p= 5
i= 1 and *p= 1
newprogram.cpp-
#include <iostream>
using namespace std;
int main(){
int* p = new int(5); //p now refers to a new integer object, 5
cout << "p points at address " << p << "\n"; //where the new object is in memory
cout << "The data stored in address " << p << " is " << *p << "\n"; //where the object is and what value it contains
*p = 10; //p now refers to the object as 10
cout << "Now the data stored in address " << p << " is " << *p << "\n"; //the location in memory now stores 10
return 0;
}
Output:
p points at address 0xff7010
The data stored in address 0xff7010 is 5
Now the data stored in address 0xff7010 is 10
11/13/2018
Learning Python
Focus on AI, machine learning, deep learning, neural networks
11/15/2018
Reviewing for HW Test
- Linux
- Shell scripting
- C++ coding
- Physics graphs
- Accelerator problems
- ROOT
- LHC (probabilistic and random)
- RNG/MadGraph
- Monte Carlo/ Monte Carlo ID
- Parts of CMS detector
- iSpy collisions
- Python
LHC collisions rely on the fact that quantum mechanics is probabilistic and random
Jets are streams of particles that cannot exist on their own