Skip to content

Instantly share code, notes, and snippets.

View wesyoung's full-sized avatar
🎯
Focusing

wes wesyoung

🎯
Focusing
View GitHub Profile
import os
import autogen
import memgpt.autogen.memgpt_agent as memgpt_autogen
import memgpt.autogen.interface as autogen_interface
import memgpt.agent as agent
import memgpt.system as system
import memgpt.utils as utils
import memgpt.presets as presets
import memgpt.constants as constants
import memgpt.personas.personas as personas
@wesyoung
wesyoung / keras_models.md
Created January 10, 2019 17:27 — forked from candlewill/keras_models.md
A collection of Various Keras Models Examples

Keras Models Examples

一系列常用模型的Keras实现

DNN

Multilayer Perceptron (MLP) for multi-class softmax classification

from keras.models import Sequential
@wesyoung
wesyoung / loadModel.py
Created June 22, 2018 20:05 — forked from vgpena/loadModel.py
Basic text classification with Keras and TensorFlow
import json
import numpy as np
import keras
import keras.preprocessing.text as kpt
from keras.preprocessing.text import Tokenizer
from keras.models import model_from_json
# we're still going to use a Tokenizer here, but we don't need to fit it
tokenizer = Tokenizer(num_words=3000)
# for human-friendly printing
@wesyoung
wesyoung / securitai-lstm-model.py
Created June 2, 2018 23:10 — forked from adamkusey/securitai-lstm-model.py
SecuritAI LSTM RNN Model
model = Sequential()
model.add(Embedding(num_words, 32, input_length=max_log_length))
# Prevent overfitting using dropout method of regularization
model.add(Dropout(0.5))
model.add(LSTM(64, recurrent_dropout=0.5))
model.add(Dropout(0.5))
# Condense to single binary output value
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Training set automatically split 75/25 to check validation loss/accuracy at each epoch
@wesyoung
wesyoung / yarm.config
Created May 7, 2018 15:43 — forked from gssbzn/yarm.config
Elastic Beanstalk Rails+Webpacker extension
# Copyright 2018 SwiftComply.com
commands:
01_node_install:
test: "[ `node --version` != 'v8.10.0' ]"
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
02_yarn_repo:
test: "[ ! -f /etc/yum.repos.d/yarn.repo ]"
command: "curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo"
03_yarn_install:
test: "[ ! -x /usr/bin/yarn ]"
@wesyoung
wesyoung / circleci-2.0-eb-deployment.md
Created April 13, 2018 17:54 — forked from ryansimms/circleci-2.0-eb-deployment.md
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

@wesyoung
wesyoung / capybara cheat sheet
Created August 21, 2017 10:50 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@wesyoung
wesyoung / purge.sh
Created February 25, 2014 13:09 — forked from adrienbrault/purge.sh
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5