Skip to content

Instantly share code, notes, and snippets.

View thulc's full-sized avatar

achang thulc

  • THU
  • Shenzhen
View GitHub Profile
@thulc
thulc / update_lambda_vector.py
Created May 27, 2023 16:43
This file only used for show the logic, it is part of RL-MPCA
# phase_real_mean 是已知的算力消耗平均值,拿到了这个均值之后,进行 lambda_vector 的一次的更新
def update_lambda_vector(self, lambda_vector, phase_real_mean, target_real):
# 从字符串到1D tensor一条龙服务
auto_lambda_alpha = [float(s) for s in self.global_params["auto_lambda_alpha"].split("_")]
auto_lambda_alpha = [tf.reshape(tf.convert_to_tensor(x), [1]) for x in auto_lambda_alpha]
auto_lambda_alpha = tf.concat(auto_lambda_alpha, axis=0)
delta_lambda = auto_lambda_alpha*((phase_real_mean - target_real)/target_real)
@thulc
thulc / 斯坦福大学的强化学习金融课程
Created November 29, 2022 05:26
Foundations of Reinforcement Learning with Applications in Finance
http://web.stanford.edu/class/cme241/
Overview of the Course
Theory of Markov Decision Processes (MDPs)
Dynamic Programming (DP) Algorithms
Backward Induction (BI) and Approximate DP (ADP) Algorithms
Reinforcement Learning (RL) Algorithms
Plenty of Python implementations of models and algorithms
We apply these algorithms to 5 Financial/Trading problems:
(Dynamic) Asset-Allocation to maximize Utility of Consumption
@thulc
thulc / pdf_to_excel.py
Created October 17, 2022 14:33
convert all the tables in pdf to excels
from ctypes.util import find_library
print(find_library("gs"))
import camelot
# pdf path
path3 = '/Users/paul/Code/2015年中册_small.pdf'
# data save path
data_path='/Users/paul/PycharmProjects/pythonProject/pdf2excel/data/'
@thulc
thulc / 机器学习数据集
Created October 16, 2022 12:27
哪里去找数据集呢?
这里有强大的搜索引擎
https://www.projectpro.io/article/100-machine-learning-datasets-curated-for-you/407
谷歌数据集搜索
https://datasetsearch.research.google.com/
@thulc
thulc / block_emotions.py
Created October 16, 2022 12:07
感情屏蔽是成功的必备技能
# how ?
# just read paper and write code