Skip to content

Instantly share code, notes, and snippets.

View ravishchawla's full-sized avatar

Ravish Chawla ravishchawla

View GitHub Profile
pd.DataFrame(list(zip(transaction_data_only.columns[2:], tuned_rf_model.feature_importances_)), \
columns=['Attribute', 'Feature Importance']).sort_values(by='Feature Importance', ascending=False)
@ravishchawla
ravishchawla / duel-network-3.py
Last active September 27, 2019 13:57
Dueling Q Network training
state, dqn_agent = env.reset(train_mode=True)[brain_name].vector_observations[0], Agent(state_size, action_size, 1024);
scores, discount = [], EPS;
for ite in range(1, num_iterations+1):
score, env_info = 0, env.reset(train_mode=True)[brain_name];
state = env_info.vector_observations[0];
for t_step in range(max_timesteps):
action = dqn_agent.act(state, discount);
@ravishchawla
ravishchawla / duel-network-4.csv
Last active September 27, 2019 17:03
Duel Network hyperparameters
Hyperparameter value
Number of Episodes 2000
Number of Timesteps 1000
Print Checkpoint step every 4
Training Batch Size 64
Discount Rate / Gamma 0.99
Learning Rate / alpha 5e-4
Number of Hidden Layers 2
Fully Connected Layer 1 Units 64
Fully Connected Layer 2 Units 64
@ravishchawla
ravishchawla / ddpg_hyperparameters.csv
Created November 9, 2019 02:54
DDPG Hyperparameters
Hyperparameter value
Replay Buffer Size 1e5
Minibatch Size 128
Discount Rate 0.99
TAU 1e-3
Actor Learning Rate 1e-4
Critic Learning Rate 1e-4
L2 Weight Decay 0
class Agent():
"""Interacts with and learns from the environment."""
def __init__(self, state_size, action_size, replay_memory, batch_size, random_seed):
"""Initialize an Agent object.
- Instantiate the Agents and Critics, Replay Memory, and a Noise process
"""
def step(self, state, action, reward, next_state, done):
def multi_ddpg(n_episodes=5000, max_t=2000):
init_time = time.time();
scores_deque = deque(maxlen=100);
scores = []
max_score = -np.Inf;
for i_episode in range(1, n_episodes+1):
ep_init_time = time.time();
env_info = env.reset(train_mode=True)[brain_name];
states = env_info.vector_observations;
Agent Hyperparameters
Replay Buffer Size 1e5
Minibatch Size 128
Discount Rate 0.99
TAU 1e-3
Actor Learning Rate 1e-4
Critic Learning Rate 1e-4
L2 Weight Decay 1e-6
Actor Model Hyperparameters
{
"openapi":"3.0.1",
"info":{
"title":"The Jira Cloud platform REST API",
"description":"Jira Cloud platform REST API documentation",
"termsOfService":"http://atlassian.com/terms/",
"contact":{
"email":"[email protected]"
},
"license":{
@ravishchawla
ravishchawla / check_coverage.py
Created March 20, 2020 16:52
quora_check_coverage
def check_coverage(text, embeddings_dict):
known_words, unknown_words = {}, {};
total_known, total_unknown = 0, 0;
for sentence in text:
for word in sentence.split(' '):
if word in known_words:
total_known = total_known + 1;
elif word in embeddings_dict:
known_words[word] = embeddings_dict[word];
@ravishchawla
ravishchawla / data_cleaning_methods.csv
Last active March 20, 2020 16:59
quora_data_cleaning
Data Cleaning Procedure Coverage of Vocabulary Coverage of Dataset
Raw Data (all records) 0.18 0.71
Raw Data (on 10% sample) 0.08 0.71
Lower Casing all words (on 10% sample) 0.10 0.87
Removing and Replacing Non-Alpha Numeric Characters (on 10% sample) 0.11 0.98
Replacing Contractions with Full words (on 10% sample) 0.11 0.98
All methods (all records) 0.27 0.98