$ 2024-10-23
Weekly Logs
Agenda
Date: 2024-10-23; Time: 00:18
-
Conference paper: Update my methodology:
- Edit: Phase 1 Data Collection
- 1. Compiling Visually Descriptive Materials
- Explain the primary documents and where I got them
- Explain the secondary documents and why I reference them
- 2. Developing a Object-Based Classification Guide (OB-CG)
- Add the certainty/uncertainty measurement
- Add the SEGEPLAN's Panzos georefs
- Use basic shapes as settlement pins OR use outline masks as settlement identifiers
- Note: For the CNN, it might be a better idea to literally outline everything I see rather than just put a pin on it because it will give the CNN a better understanding of that object's spatial distribution across the land
- So, I can mess with the fill in opacity to represebt the certainty/uncerainty value? If so, I can keep those as vectors and rasterize them in Python
- Note: For the CNN, it might be a better idea to literally outline everything I see rather than just put a pin on it because it will give the CNN a better understanding of that object's spatial distribution across the land
- 1. Compiling Visually Descriptive Materials
- Redo: Phase 2 Data Transformation
- Follow these steps
- In Google Earth Pro
- Prep the mapping area with raster images
- Choose which time (2006, 2007, or 2010)
- Extend to Panzos (to only high-res)
- Identify observation features with my OB-CG
- Prep the mapping area with raster images
- In Python
- Convert my KMZ files into shape files
- Prep my dataset for data modelling
- In Google Earth Pro
- Follow these steps
- Edit: Phase 1 Data Collection
-
Thesis design: Reorganize My Ref Tracker
- Maybe making subtrackers for each purpose: Empirics, Methods, Theory
- Then, I can better identify which sources will be used for what and how to group sources within each section
- I'm thinking that, for each source, I can add metadata as YAML:
- Purpose section (i.e. empirics, methods, theory)
- Primary/secondary status
- Time scope
- Geographic scope
- Journal tags
- My tags
- URL source
- Maybe making subtrackers for each purpose: Empirics, Methods, Theory
Date: 2024-11-03; Time: 20:01
Okay, I'm still working with the same agenda from last week so I'll just keep working here:
- Prep for Redo: Phase 2 Data Transformation
- Translate Panzos document
- Organize all the georef images in one directory
Recap
Methodological Notes
Date: 2024-10-23; Time: 17:14
Found a couple of links for learning OOP (object-oriented programming) in Python
- Object-Oriented Programming (OOP) in Python – Real Python
- Object-Oriented Programming in Python (OOP): Tutorial | DataCamp
Here are my notes:
What is OOP?
- It is a programming paradigm
- Which eplains how to structure programs so that attributes/properties and methods/behaviours are bundled into individual objects
- An object could be a person
- Properties = name, age, and address
- Behaviors = walking, talking, breathing, and running
- A class represents the 'blueprint' an object
- Each class has their own properties (characteristics they possess), and behaviours (actions they perform)
- An instance represents the 'real' data of an object from a certain class
- An object could be a person
- Which eplains how to structure programs so that attributes/properties and methods/behaviours are bundled into individual objects
Build PyTorch CNN - Object Oriented Neural Networks - deeplizard
Here are my notes:
What are Objects?
- An object is defined in code using classes
What are Classes?
- A class defines the object's specification/spec, which specifies what properties and behaviours each object of the class should have
- When we create an object of a class --> object an instance of the class
What are Instances?
-
Each instance of a class have 2 core components:
- Methods ("code")
- Aka behaviours
- Attributes ("data")
- Aka properties
- Methods ("code")
-
So, the methods and attributes are defined by the class.
Pros of OOP?
- In a given program, many objects or instances of a given class can exist simultaneously
- All of the instances will have the same available attributes and the same available methods
- So, they are both uniform and complex in their data structure
- Properties (data) and behaviours (code) can be encapsulated within an object
- The difference between objects of the same class is the values contained within the object for each attribute
- Each object has its own attribute values
- These values determine the internal state of the object
- The difference between objects of the same class is the values contained within the object for each attribute
Building NNs with PyTorch
- Import the torch.nn package, which is PyTorch's neural network (nn) library
import torch.nn as nn
- Note: Allows access neural network package using the 'nn' alias
- From now on, if we say nn, we mean torch.nn
- This package contains all of the typical components needed to build neural networks
What are Layers?
- Each layer in a neural network has two primary components:
- A transformation ("code")
- Aka behaviours
- A collection of weights ("data")
- Aka properties
- So, layers can represent objects by employing OOP!
Okay, that's enough notes, I'm gonna focus on my own research again.
Date: 2024-10-23; Time: 20:08
I found a how-to for preparing KMZ files in python: A Beginner’s Guide to Handling Geospatial Data Using Python | by NOUHAILA DRAIDAR | Medium
Also, here's the API reference of geopandas: API reference — GeoPandas 1.0.1+0.g747d66e.dirty documentation
Date: 2024-10-28; Time: 16:20
So, Bahar said I would have to incorporate probability when coding the uncertainty value for each observation data/object. Uhhh still not sure how to do that but when I look up how to do that I run into the term polymorphism.
Turns out that any programming language that can accomodate for OOP must be polymorphic. Seems like Java is most commonly used for this stuff or other languages but I'll stick to Python.
I found this for learning polymorphism in python: What is Polymorphism in Python?
Here are my notes:
What is Polymorphism?
- In programming, it means that a single entity can behave in multiple ways depending on the context
- It is a basic condition of a programming language that affects how the language works at various levels:
1. Operator Polymorphism
- Aka operator overloading
- When one symbol can be used to perform multiple operation in different contexts
2. Function Polymorphism
- When one function can act on multiple data types and structures to yield different kinds of information.
- Ex: Python's built-in len() function = can return the length of an object
- But will measure the length of the object differently depending on the object’s data type and structure
- If the object is a string --> it will return the number of characters in the string
- If the object is a list --> it will return the number of entries in the list
3. Class and Method Polymorphism
- This makes it easier to repurpose classes and methods
- Remember:
- Class = like a blueprint
- Object = like a concrete instantiation of that blueprint
- Method = like the reoccurs in the objects that instantiate that class
- Remember:
- Ex: If you generate a new class from a preexisting class, the new class will inherit the methods of the preexisting class
- New class becomes the a “child class”
- Preexisting class becomes the “parent class”
- So, the parent class establishes the method type, which the child class inherits
- But, objects instantiated from the child class use the redefined method, not the original method
- Aka method overriding
Date: 2024-11-05; Time: 20:50
I really hate having to manually georef all my raster images in GEPro. I do not want to do that again. I give in, I'm gonna use ArcGIS for that:
Georeferencing tools—ArcGIS Pro | Documentation
I'm using bodies of water as my control points to match up all the georef images together. I did it all manually last time but that meant that some of the rivers or water borders didn't match up all the way. Okay technically you could do it in QGIS too...so its still a free thing...
Date: 2024-11-05; Time: 23:55
Right now, I will not redo my georef technique in phase 2. I will focus on redoing my observation data. When I write it in the Conference working paper, I can just disucss how I can improve my georef technique by using bodies of water as the control points.
I also need to write up my OOP technique for phase 3. I need to make a UML diagram!
UML Diagrams Full Course (Unified Modeling Language)
Here are my notes:
What is UML?
Unified Modelling Language
- A set of best engineering practices using graphical notation
- Meant to help software developers to define design and document system artifacts
- Important for object-oriented software development
- Purpose is to provide a standardized annotation that can be used by all object-oriented methods
UML Diagram Types:
- Structural diagrams:
a. Composite structure
b. Deployment
c. Package
d. Profile
e. Class
f. Object
g. Component - Behavioural diagrams:
a. Activity
b. Use case
c. State machine
d. Interaction
d.1 Sequence
d.2 Communication
d.3 Interaction overview
d.4 Timing
Class diagram
- Central technique used in most object-oriented methods
- Describes the types of objects in the system and different kinds of static relationships between them
- An abstract model of classes and their relationships
- A class is a template for creating objects
- Represents objects as initial state attributes and behaviour methods
- Each attribute has its own type
- Each method has is own signature
- Ex, Class: Dog
- State (attributes):
- Colour, height, length, weight, age
- Behaviour (methods):
- Sit, bark, run, eat
- State (attributes):
3 Main types of relationships
- Association
- Represents instances of types
- Ex: a person works for a company or a company has multiple offices
- Inheritance
- Corresponds directly to inheritence in object-oriented deisgn
- Aggregation
- Form of object composition
How to write a class

- The top partition, the name of the class
- The next partition, attributes followed by their type
- The bottom parition, methods followed by the type that they can return after the the column in the methods signature
What are the - and +?
- These are the access modifiers or class visibility notation
- + is public; - is private; # is protected; ~ is package local
In each method, every parameter can be described in its direction
- in = the value of the input is used by the method but the method does not change the input
- inout = the value of the input is used by the method and the method can change the input itself
- out = the input is used as an output parameter, which means it serves as a repository for the output value of the method
Object diagram
- Is an instance of the class diagram
- Shows a detilaed snapshot of the system's state at a particular point in time
- Which is concrete in nature
- Uses of object diagrams are limited; mainly to show examples of data structures
How to interpret UML diagrams?
3 Levels of specification
- Conceptual perspective
- Diagrams are interpreted as describing entities of the real world
- Considered language independent
- Specification perspective
- Diagrams are interpreted as describing abstractions of software or compontents with specification and interfaces
- But without any reference to a specific implementation
- Implementation perspective
- Diagrams are interpreted as descriptions of a specific implementation in a programming technology or lamguage
- So, you can choose to depict the actual software implementation
6 Relationships between classes

- Association = a connection between classes
- Inheritance = a relationship between a parent class and its descendants
- Hallow arrow points to parent class
- If descendents inherits from an abstract class, the name of the parent class is italicized
- Ex, Shape <-- Square, Rectangle, Circle
- All these classes are connected and point to 'Shape'
- Realization = relationships between an interface and objects
- The object implements the interface
- Ex, Owner: +buy(property) <-- Person: -tangible & Owner: +buy(property) <-- Corporation: -intangible
- These are two classes with two separate connections to 'Owner'
- Dependency = when an object of one classes uses an object of another class in its method
- Special cas eof association of two classes
- Where changes in one class will inexorably entail changes in the other
- Ex, Person: +hasRead(book): boolean --> Book
- Aggregation = when one class is a composite part of another
- Ex, a programmer's 'work station' can consist of a chair, desk, computer, and fan or
- When you delete the 'work station' class, you can still have all these classes but on their own
- They no longer form an aggregate class which is 'work station'
- Ex, Class workspace <-- Table, chair, PC, fan
- All these classes are connected and point to 'Class workspace'
- Ex, a programmer's 'work station' can consist of a chair, desk, computer, and fan or
- Composition = type of aggregation where the aggregate class is destroyed will also destroy the classes
- Ex, our bodies are made up of organs but those organs can't function along without being in the body
Okay, I think that's everything I need to know for now. Gotta draw it.
Reflective Notes
Date: 2024-11-06; Time: 01:18
My friend, June, gave me his CS148 notes on OOP! Awesome.
Also my friend, Dom, helped me scribble out my observatiom data as objects. He was the one that told me I should make a UML diagram.
I will definately not be ready with my data fully modelled for the conference this end of November. So...the paper is going to have to explain my conceptual data model at least. I need to redo my observation data so that all the placemarkers are polygons rather than some of them being points. I'm also extending my study area into Panzos so yea that has to be done...
Ahh...all of this has to be reexecuted and rewritten...
...I sorta put alot on myself.
I'm really nervous to present. One, this is a half-baked idea. Two, I'm speedrunning computer science. Three, I have stage fright. Four, it looks like other paper presenters are at least PhD students....uhh...
Prev: $ 2024-10-18
Next: $ 2024-11-11
#notes/learn/OOP
#notes/learn/python/pytorch
#notes/learn/python/geopandas
#notes/learn/python/polymorphism
#notes/learn/UML