Phil 12.21.2022

Shortest day of the year! It gets better from here

Book

SBIRs

  • Early morning helping Rukan with getting everything done
  • Need to make videos when they are ready. Change all the raid numbers to NINE
  • Working on some test files to train the NN to chose the nth-best choice – done
  • MORS – going to set up the History section to have numbered lessons
  • Submit for reimbursement!
import pandas as pd
from random import random
from pathlib import Path

from typing import List

class FindLowest:
    size:int
    num_items:int
    rows:int
    input_matrix:List
    output_matrix:List

    def __init__(self, num_items, size:int, rows:int = 100):
        self.num_items = num_items
        self.size = size
        self.rows = rows

    def int_to_bin_list(self, val:int, places:int = 16) -> List:
        l = []
        for i in range(places):
            b = int(val & 1 << i != 0)
            l.append(b)
        return l

    def calc_data(self, bin_list_len:int = 4):
        row = 0
        self.input_matrix = []
        self.output_matrix = []

        for r in range(self.rows):
            i = r % self.num_items
            d = {}
            #d['id'] = i
            for j in range(self.size):
                d[j] = random()
            sd = dict(sorted(d.items(), key=lambda item: item[1]))
            #print("{}, {}".format(sd.keys(), d.values()))
            best_choice = list(sd.keys())[i]
            bc_list = self.int_to_bin_list(best_choice, bin_list_len)
            id_list = self.int_to_bin_list(i, bin_list_len)
            input_d = {}
            output_d = {}
            for i in range(bin_list_len):
                input_d["b{}".format(i)] = id_list[i]
                output_d["b{}".format(i)] = bc_list[i]
            input_d.update(d)
            #print("row {}: id = {}, inout = {}, output = {}".format(row, id_list.reverse(), d, bc_list.reverse()))
            print("row {}: input_d = {}, output_d = {}".format(row, input_d, output_d))
            self.input_matrix.append(input_d)
            self.output_matrix.append(output_d)
            row += 1

    def to_csv(self, prefix:str, directory:str = None):
        if directory == None:
            directory = str(Path.home())
        df = pd.DataFrame(self.input_matrix)
        filename = "{}/{}_input.csv".format(directory, prefix)
        print("saving {}".format(filename))
        df.to_csv(filename, index=False)

        df = pd.DataFrame(self.output_matrix)
        filename = "{}/{}_output.csv".format(directory, prefix)
        print("saving {}".format(filename))
        df.to_csv(filename, index=False)



def main():
    fl = FindLowest(5, 10)
    fl.calc_data()
    fl.to_csv("test")

if __name__ == "__main__":
    main()

GPT Agents

  • Start on paper? At least get the template up and copy stuff over from the other doc
  • 4:00 Meeting