Author Archives: pgfeldman

Phil 12.4.20

UMBC now has a subscription to PolicyMap, a GIS tool that allows users to create maps, tables, and reports from a variety of datasets ranging from demographics, income, health, education, more. Maps can be created as single sheets or with multiple layers from the zip code / block level to worldwide.

Users can create individual accounts to save, share, and print work. A suite of tutorials is available to help both new and experienced users work with the tool effectively.

This is a lot of fun, and not related to anything: The Siege of Gondor, Part I: Professionals Talk Logistics

GOES

  • More Plotly

GPT Agents

Book

  • Working on Attention
  • Downloaded some seaturtle data from here: seamap.env.duke.edu
  • Changed over to storks, because I can’t find any example of a female seaturtle choosing a new beach
  • 2:00 Meeting with Michelle

Phil 12.3.20

It’s been a year since we heard about COVID-19 for the first time. Let’s see how things are going. First, the selection of countries that I’ve been tracking:

https://public.flourish.studio/visualisation/4504138/

Ouch. Germany and Finland seem to be doing well in Europe, but the rest… It looks like it’s going to be a bad winter. I think it is interesting how countries like France, Italy and Switzerland that seemed to have things under control are now at USA levels of deaths per million.

Let’s see how the US is doing:

https://public.flourish.studio/visualisation/4303726/

The hard-hit eastern states still look a lot like the parts of Europe that are still on top of the spread. Georgia, Mississippi, and the Dakotas look very bad. Washington and California, which were hit early, are still experiencing very low rates. I guess we’ll see how this chart looks in January. If there is a Thanksgiving-related surge, we should see it by then.

Book

  • Work on attention

GOES

  • 10:00 Meeting with Vadim. Pymoo is much better to install than Pyomo. It’s API seems more straightforward too. Vadim is working on figuring out the examples
  • 2:00 Meeting. Just a quick status
  • Status report
  • Long chat with Aaron

GPT-2 Agents

  • The generated HTML file to make that chart is huge, btw. It’s 2.9MB.
  • And it’s slooooooow if you just use fig.show(). fig.write_html(‘file_name.html’, auto_open=True) is much faster. Ok. That means the figures can be saved as dynamic pages, which is kind of cool.
  • Got dash running, which set up a server for your interactive graphs. Not really sure which one is better, though I’m guessing that data can be live inside dash graphs. I don’t think this will matter too much with the embedding charts, but it’s good to know
  • Hot-reloading is cool, and works with data or text changes. And the management of the html is nice. It appears to be based on a React engine and it’s nice to not have to care!
  • CSS-type styling works! If you make an error in the code, the program bails with an error message
  • 3:30 Meeting – cancelled

Phil 12.2.20

Call stove repair 

IntelliJ has added CodeWithMe!

I love this kind of simplifying, generalizing research:

https://twitter.com/samgreydanus/status/1333887306940387329

Book

  • More on cults, probably. Just need to get started writing again after the break – made a lot of progress!

GPT-2

  • Look at libraries for plotting embeddings interactively. The OpenGL developer in me is digging VisPy

GOES

  • SATERN training
  • Register for MORS!!! – Done!
  • 1:30 meeting with Vadim
    • Went over the Pyomo api, which is very complicated to install. It works, but getting the solvers to work in the API call framework requires all kinds of additional work.
  • 2:00 Meeting

Phil 12.1.20

Language Through a Prism: A Spectral Approach for Multiscale Language Representations (Twitter summary)

  • Language exhibits structure at different scales, ranging from subwords to words, sentences, paragraphs, and documents. To what extent do deep models capture information at these scales, and can we force them to better capture structure across this hierarchy? We approach this question by focusing on individual neurons, analyzing the behavior of their activations at different timescales. We show that signal processing provides a natural framework for separating structure across scales, enabling us to 1) disentangle scale-specific information in existing embeddings and 2) train models to learn more about particular scales. Concretely, we apply spectral filters to the activations of a neuron across an input, producing filtered embeddings that perform well on part of speech tagging (word-level), dialog speech acts classification (utterance-level), or topic classification (document-level), while performing poorly on the other tasks. We also present a prism layer for training models, which uses spectral filters to constrain different neurons to model structure at different scales. Our proposed BERT + Prism model can better predict masked tokens using long-range context and produces multiscale representations that perform better at utterance- and document-level tasks. Our methods are general and readily applicable to other domains besides language, such as images, audio, and video.

A Visual Guide to Regular Expression

https://twitter.com/emollick/status/1333571781727318019

This could be something for diversity injection?

Corporate Reporting in the Era of Artificial Intelligence

  • The researchers find that companies expecting higher levels of machine readership prepare their disclosures in ways that are more readable by this audience. “Machine readability” is measured in terms of how easily the information can be processed and parsed, with a one standard deviation increase in expected machine downloads corresponding to a 0.24 standard deviation increase in machine readability. For example, a table in a disclosure document might receive a low readability score because its formatting makes it difficult for a machine to recognize it as a table. A table in a disclosure document would receive a high readability score if it made effective use of tagging so that a machine could easily identify and analyze the content.

GPT-2 Agents

  • I want to create a database for generated output. There are two tables:
    • table_experiment – done!
      • Contains the experiment details:
        • id (key)
        • Date
        • Probe list
        • all hyperparameters
    • table_output – done!
      • id
      • experiment_id
      • root_id
      • tag (e.g. “raw”, “date”, “location”, “tweet”
      • depth (this is the index of each piece of content. Raw is 0, then each parsed out section increases depth by 1)
      • content
      • regexes
  • Created a gpt_experiments database. I need to make sure that I can read from one db and write to another
  • Good results on the test. Need to try something at a larger scale to test the embeddings:
https://viztales.com/wp-content/uploads/2020/12/image-1.png
  • 3:30 Meeting. Get script for Antonio
    • Getting small models for the long and short training sets
    • Look into embedding visualizer
    • Send Antonio info on the COVID Twitter stream while Sim assembles the scripts

GOES

  • Register for MORS
  • Status report for November

Phil 11.30.20

Call Verizon

Call stove repair – done

GPT-2 Agents

  • Upload db and corporas – done

GOES

  • Slides and presentation – done
  • 2:00 meeting with Vadim – delayed. I’m getting worried that he’s flailing again

SBIR

  • 10:00 meeting – done, waiting for names and emails

COE Meeting

  • I have my doubts if this is going to work. It seems more like an attempt by BD to get us to create a body of text that they can mine for proposals

Meeting with Aaron

  • Caught up on a lot of things

Phil 11.25.20

IRS stuff

Enjoying Google Research’s Verse by Verse

GPT-2 Agents

  • I think I want to put together a small command-line app that allows a discussion with the language model. All text from the ongoing conversation is saved and and used as the input for the next. A nice touch would be to have some small number of responses to choose from, and the conversation follows that branch.
  • Come to think of it, that could be a cool artificial JuryRoom/Eliza
  • Generate compact text for Sim to try training
  • Look into W2V 3D embedding of outputs, and mapping to adjacent outputs (The wo/man walked into the room). We know that there should be some level of alignment

GOES

  • Rehearse/record talk
  • Meeting with Vadim. He found Pyomo

Book

  • Working on the Attention + Dominance section

Phil 11.24.20

Anonymous 4: Alleluia: Gratulemur et letemur is lovely

PyTorch BigGraph is an Open Source Framework for Processing Large Graphs

  • Graphs are one of the fundamental data structures in machine learning applications. Specifically, graph-embedding methods are a form of unsupervised learning, in that they learn representations of nodes using the native graph structure. Training data in mainstream scenarios such as social media predictions, internet of things(IOT) pattern detection or drug-sequence modeling are naturally represented using graph structures. Any one of those scenarios can easily produce graphs with billions of interconnected nodes. While the richness and intrinsic navigation capabilities of graph structures is a great playground for machine learning models, their complexity posses massive scalability challenges. Not surprisingly, the support for large-scale graph data structures in modern deep learning frameworks is still quite limited. Recently, Facebook unveiled PyTorch BigGraph, a new framework that makes it much faster and easier to produce graph embeddings for extremely large graphs in PyTorch models.

GOES

  • Add composite rotation vector to ddict output. It’s kind of doing what it’s supposed to
  • Think about a NN to find optimal contributions? Or simultaneous solution of the scalars to produce the best approximation of the line? I think this is the way to go. I found pymoo: Multi-objective Optimization in Python
    • Our framework offers state of the art single- and multi-objective optimization algorithms and many more features related to multi-objective optimization such as visualization and decision making. Going to ask Vadim to see if it can be used for our needs
  • MORS talk, headshots, slides, etc
  • 11:00 meeting with Vadim

GPT-2 Agents

Phil 11.23.20

Call Jim Donnie’s! Sheesh – they are booked until January. Going to bring it by for someone to look at

Got the reviews back from AAMAS. Not as bad as SASO, but not great. I think I’ll write a rebuttal because why not? And it’s only 800 words

Call for Papers for Special Issue: Artificial Speakers – Philosophical Questions and Implications

  • With the increasing ubiquity of natural language processing (NLP) algorithms, interacting with “conversational artificial agents” such as speaking robots, chatbots, and personal assistants will be an everyday occurrence for most people. In a rather innocuous sense, we can perform a variety of speech acts with them, from asking a question to telling a joke, as they respond to our input just as any other agent would.

Book

  • Write some of the “Attention + Dominance” paper/chapter outline for Antonio. It’s important to mention that these are monolithic models. It could be a nice place for the Sanhedren 17a discussion too.

GOES

  • Rework primary_axis_rotations.py to use least-squares. It’s looking pretty good!
https://viztales.com/wp-content/uploads/2020/11/image-11.png
  • Folding into sim.
https://viztales.com/wp-content/uploads/2020/11/replayer_11_23_20.gif
  • It’s still not right, dammit! I’m beginning to wonder if the rwheels are correct? Wheels 1 and 4 are behaving oddly, and maybe 3. It’s like they may be spinning the wrong way?
  • Nope, it looks like it is the way the reaction wheel contributions are being calculated?
https://viztales.com/wp-content/uploads/2020/11/image-12.png
  • I think this is enlightening. There seems to be some kind of interplay between the computed rotation and the approximation based on the rwheels:
https://viztales.com/wp-content/uploads/2020/11/image-13.png

Phil 11.22.20

The Language Interpretability Tool (LIT): Interactive Exploration and Analysis of NLP Models

  • With these challenges in mind, we built and open-sourced the Language Interpretability Tool (LIT), an interactive platform for NLP model understanding. LIT builds upon the lessons learned from the What-If Tool with greatly expanded capabilities, which cover a wide range of NLP tasks including sequence generation, span labeling, classification and regression, along with customizable and extensible visualizations and model analysis. (GitHub)

Phil 11.20.20

From the Washington Post this morning

Book

  • Read and annotate Michelle’s outline, and add something about attention. That’s also the core of my response to Antonio
  • More cults
  • 2:00 Meeting
  • Thinking about how design must address American Gnosticism, and the danger and opportunities of online “research”, and also how things like maps and diversity injection can potentially make profound impacts

GOES

  • Update test code to use least squares/quaternion technique
  • look into celluloid package for animating pyplot
  • 3:00 Meeting

GPT-2 Agents

import tensorflow as tf
# pip install git+https://github.com/huggingface/transformers.git
from transformers import TFGPT2LMHeadModel, GPT2Tokenizer

# options are (from https://huggingface.co/transformers/pretrained_models.html)
# 'gpt2' : 12-layer, 768-hidden, 12-heads, 117M parameters. # OpenAI GPT-2 English model
# 'gpt2-medium' : 24-layer, 1024-hidden, 16-heads, 345M parameters. # OpenAI’s Medium-sized GPT-2 English model
# 'gpt2-large' : 36-layer, 1280-hidden, 20-heads, 774M parameters. # OpenAI’s Large-sized GPT-2 English model
# 'gpt2-xl' : 48-layer, 1600-hidden, 25-heads, 1558M parameters.. # OpenAI’s XL-sized GPT-2 English model
tokenizer = GPT2Tokenizer.from_pretrained("../models/chess_model")

# add the EOS token as PAD token to avoid warnings
# model = TFGPT2LMHeadModel.from_pretrained("../models/gpt2-medium", pad_token_id=tokenizer.eos_token_id)
model = TFGPT2LMHeadModel.from_pretrained("../models/chess_model", pad_token_id=tokenizer.eos_token_id, from_pt=True)

wte = model.transformer.wte
wpe = model.transformer.wpe
word_embeddings:tf.Variable = wte.weight  # Word Token Embeddings
print("\nword_embeddings.shape = {}".format(word_embeddings.shape))
terms = ['black', 'white', 'king', 'queen', 'rook', 'bishop', 'knight', 'pawn']
for term in terms:
    text_index_list = tokenizer.encode(term)
    print("\nindex for {} = {}".format(term, text_index_list))
    for ti in text_index_list:
        vec = word_embeddings[ti]
        print("{}[{}] = {}...{}".format(term, ti, vec[:3], vec[-3:]))
  • It gives the following results:
word_embeddings.shape = (50257, 768)
 index for black = [13424]
 black[13424] = [ 0.1466832  -0.03205131  0.13073246]…[ 0.03556942  0.2691384  -0.15679955]
 index for white = [11186]
 white[11186] = [ 0.01213744 -0.08717686  0.09657521]…[-0.01646501  0.05803612 -0.14158668]
 index for king = [3364]
 king[3364] = [ 0.07679952 -0.36437798  0.04769149]…[-0.2532825   0.11794613 -0.22853516]
 index for queen = [4188, 268]
 queen[4188] = [ 0.01280739 -0.12996083  0.10692213]…[0.03401601 0.01343785 0.30656403]
 queen[268] = [-0.17423214 -0.14485645  0.04941033]…[-0.16350408 -0.10608979 -0.03318951]
 index for rook = [305, 482]
 rook[305] = [ 0.08708595 -0.13490516  0.17987011]…[-0.17060643  0.07456072  0.04632077]
 rook[482] = [-0.07434712 -0.01915449  0.04398194]…[ 0.02418434 -0.06441653  0.26534158]
 index for bishop = [27832]
 bishop[27832] = [-0.05137009 -0.11024677  0.0080909 ]…[-0.02372078  0.00158158 -0.08555448]
 index for knight = [74, 3847]
 knight[74] = [ 0.10828184 -0.20851855  0.2618368 ]…[0.10234124 0.1747297  0.15052234]
 knight[3847] = [-0.15940899 -0.14975397  0.13490209]…[ 0.01935775  0.056772   -0.08009521]
 index for pawn = [79, 3832]
 pawn[79] = [-0.02358418 -0.18336709  0.08343078]…[ 0.23536623  0.06735501 -0.13106383]
 pawn[3832] = [0.12719391 0.05303555 0.12345099]…[-0.15112995  0.14558738 -0.05049708]

Phil 11.19.20

GPT-2 Agents

  • Looks like we are getting close to ingesting all the new data
  • Had a meeting with Ashwag last night (Note – we need to move the time), and the lack of ‘story-ness’ in the training set is really coming out in the model. The meta information works perfectly, but it’s wrapped around stochastic tweets, since there is no threading. I think there needs to be some topic structure in the meta information that allows similar topics to be grouped sequentially in the training set.
  • 3:30 Meeting

GOES

  • 9:30 meeting
  • Update code with new limits on how small a step can be. Done, but I’m still having normal problems. It could be because I’m normalizing the contributions?
https://viztales.com/wp-content/uploads/2020/11/replayer_11_19_20.gif
  • Switching to a least-squares approach done?!
transform = lambda x: unpad(np.dot(pad(x), A))

print("\nTarget:")
print(secondary)
print("\nResult:")
print(transform(primary))
print("\nMax error: \n{}".format(np.abs(secondary - transform(primary)).max()))
print("\nA = \n{}".format(A))

Ap = A[:3, :3]
print("\nrotation matrix = \n{}".format(Ap))


print("getting quaternion")
q = Quaternion(matrix=Ap)
print("got quaternion")
print("Axis = {}".format(q.get_axis()))
print("Degrees = {}".format(q.degrees))

Book

  • More cults. Tying together Jonestown and Moby-Dick seems to be working better that what I was doing before

Phil 11.18.20

GPT-2 Agents

  • Good meeting last night. The next action items are to
    • Figure out how to build embeddings from generated tweets
    • Finish updating database
    • Create new training set
    • Train small and medium models using current and compact meta frame (something like [[month, location, retweets]], or some similar easy regex)
  • Need to register for Emerging Techniques forum: mors.org/Events/Workshops/Emerging-Techniques-Forum

GOES

  • Need to fix the angle rollover in vehicle (and reference?) frames. I don’t think that it will fix anything though. I just don’t get why the satellite drifts after 70-ish degrees:
  • There is something not right in the normal calculation?
https://viztales.com/wp-content/uploads/2020/11/replayer_11_18_20.gif?w=986
  • I think the problem is going to be here. Need to dig into this in a scratch file:
def get_angle(self, v1:Tuple, v2:Tuple) -> [float, float]:
dot = np.dot(v1, v2)
v1norm = np.linalg.norm(np.array(v1))
v2norm = np.linalg.norm(np.array(v2))
v1n_v2n = v1norm*v2norm
normdot = np.divide(dot, v1n_v2n)
# r_angle = np.arccos(np.clip(dot, -1.0, 1.0))
r_angle = np.arccos(normdot)
d_angle = math.degrees(r_angle)
# print("rads = {}, degrees = {}".format(r_angle, d_angle))
return r_angle, d_angle
  • The small angle steps seem to also be causing a problem:
https://viztales.com/wp-content/uploads/2020/11/image-8.png
  • Need to finish my telecommute form

Book

  • Writing cults section.

Phil 11.17.20

GOES

  • Got my panda3D text positioning working. I create a node and then attach the text to it. I think that’s not needed, that all you have to do is use render rather than the a2* options. Here’s how it works:
for n in self.tuple_list:
ls:LineSegs = self.lp.get_LineSeg(n)
node = TextNode(n)
node.setText(n)
tnp:NodePath = self.render.attachNewNode(node)
#tnp.set_pos(-1, ypos, 1)
tnp.setScale(0.1)
self.text_node_dict[n] = tnp
  • I then access the node paths through the dict

Book

  • Spent a good chunk of the morning discussing the concept of dominance hierarchies and how they affect networks with Antonio
  • Need to write some, dammit!

GOES

  • My abstract has been accepted at the Military Operations Research Symposium’s (MORS) 4 day workshop in November!
  • More Replayer. Working on text nodes. Done! It looks good, and is pointing out some REALLY ODD THINGS . I mean, the reaction wheel axis are not staying with the vehicle frame…
  • 10:00 meeting with Vadim
  • The (well, a) problem was that the reaction wheel vectors weren’t being reset each time, so the multiplies accumulated. Fixed! Now we have some additional problems, but these may be more manageable:
https://viztales.com/wp-content/uploads/2020/11/image-6.png

GPT-2 Agents

  • Continuing to ingest tweets:
  • 3:30 Meeting

Phil 11.16.20

How things are going

GPT-2 Agents

  • Ingesting more data. It may take a while

GOES

  • Continuing with Replayer
  • Got the points moving based on the spreadsheet. I need to label them. It looks pretty straightforward to use 3D positions? I may have to use Billboards to keep things pointing at the camera

Phil 11.13.20

Book

  • Look into Prof. Kristin Du Mez (Calvin College – @kkdumez)’s book (Jesus and John Wayne)?
  • More writing
  • Meeting with Michelle. Came up with an interesting tangent about programming/deprogramming wrt software development and cults

GPT-2 Agents

  • Adding an optional split regex to parse_substrings. Here’s how I wound up doing it. This turns out to be slightly trickey, because the matches don’t include the text we’re interested in, so we have a step that splits out all the individual texts. We also throw away the text that leads to the first line and the last line of text since both can be assumed to be incomplete
split_regex = re.compile(r"(?=On [a-zA-Z]+ of [0-9]+,)")
split_iter = split_regex.finditer(tweet_str)
start = 0
tweet_list = []
for s in split_iter:
t = tweet_str[start: s.start()]
tweet_list.append(t)
start = s.start()
  • Shimei’s presentation went well!
  • Work on translation

GOES

  • Start on playback of the vehicle and reference frames