<jupyter_start><jupyter_text>time lag<jupyter_code>X.shape[-1]
clstm = cLSTM(X.shape[-1], hidden=2).cuda(device=device)
train_loss_adam = train_model_ista(
    clstm, X, context=2, lam=10.0, lam_ridge=1e-2, lr=1e-3, max_iter=20000,
    check_every=50)
GC_est = clstm.GC().cpu().data.numpy()
fig, axarr = plt.subplots( figsize=(10, 5))
axarr.imshow(GC_est, cmap='Blues', vmin=0, vmax=1, extent=(0, len(GC_est), len(GC_est), 0))
axarr.set_ylabel('Affected series')
axarr.set_xlabel('Causal series')
print('Estimated variable usage = %.2f%%' % (100 * np.mean(GC_est)))
print('less loss = ',min(train_loss_adam).cpu().numpy())
GC_list = []
loss_list =[]
for i in range(11):
    clstm = cLSTM(X.shape[-1], hidden=2).cuda(device=device)
    
    train_loss_adam = train_model_ista(
        clstm, X, context=i+1, lam=10.0, lam_ridge=1e-2, lr=1e-3, max_iter=20000,
        check_every=50)
    GC_list.append(clstm.GC().cpu().data.numpy())
    loss_list.append(train_loss_adam)
    
len(GC_list)
np.save('GC_list.npy',GC_list)
np.save('loss_list.npy',loss_list)
len(loss_list)
loss_list_2 = []
for i in range(len(loss_list)):
    loss_list_2.append(min(loss_list[i]).cpu().numpy())
np.save('loss_list.npy',loss_list_2)
a = np.load('loss_list.npy')
sum(GC_list[0])
sum(GC_list[1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18985395849346656, 'fraction_numerical': 0.04073789392774789, 'mean_word_length': 5.78125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '429363', 'license': 'Apache-2.0', 'n_tokens_mistral': 603, 'n_tokens_neox': 576, 'n_words': 79, 'path': 'cs224w/16-17.ipynb', 'repo_name': 'kidrabit/Data-Visualization-Lab-RND', 'size': '1301'}