Alchemical free energy calculations for the masses

Alchemical free energy calculations for the masses. See our website for more information. This library is made available under the MIT open source license. This is pre-alpha work, it should not be considered ready for production and API changes are expected at any time without prior warning. Dependencies can be installed via conda through: conda env create -f environment.yml The openfe library can be installed via: python -m pip install –no-deps . The OpenFE development team. OpenFE is an Open […]

Read more

Genetic Algorithm based hyperparameter tuning tools for Reversi gaming AI (MIninax search with alpha-beta pruning)

CS303《人工智能》课程的第一个大作业,反向规则黑白棋(传统黑白棋是棋子多的一方获胜,反向黑白棋是棋子少的一方获胜)。 这个仓库包含以下内容 黑白棋模拟器 ReversiSimulator(用matplotlib.scatter即可实现简易的棋盘打印功能) Minimax搜索 + $alpha-beta$剪枝 agents/ 评估函数的设计 agents/ (位置权重,稳定子,前沿子,行动力,时间权重(考虑得不够多)) 遗传算法调参 evolve.py(重头戏,一众Minimax里面获胜变成精挑参数比赛) 快速使用 *这本质是个调参项目,重点是调参而不是下棋,运行之前先pip install -r requirements.txt python evolve.py 默认演化1000代,可以ctrl+C打断然后去checkpoints/里看结果 规则 提交一个.py文件,包括一个class AI,实际操作时会依次调用双方AI的go方法,结果放在self.candidate_list中,取最后一个作为这一方决定的落子点。 每一步限制5秒,5秒后打断玩家并从candidate_list中去最后一个作为落子点。违规行为(如落子点不能落子,抛出未处理的异常等)会被直接判负。 比赛包含排位赛和循环赛两部分,排位赛不入总分,循环赛中每个玩家会与所有其他玩家分别执黑执白对战两局。 每个玩家只能使用一个CPU线程,可以使用的第三方包:numpy,timeout_decorator,numba(后来加入)。 前置知识 详细讲过的:Python入门,图搜索算法,Minimax搜索算法只是提到过的:MCTS 使用方法 这个仓库原本只用来下黑白棋,不过其他模式的超参数也可以用它来调整(毕竟AI年年下棋,说不定万一用得上),你需要: 一个(或者多个)Agent对象,实现两个方法:self.to_list()把自己的参数转化为列表,self.from_list(list)从一个列表里加载参数,就可以用GeneticAlgorithm里的方法进行遗传变异 一个(或者多个)种群评估函数(fitness) 编写你自己的evolve.py脚本,可以定义自己的评估过程和参数的上下界,遗传变异的选择参数和变异用的随机函数都可以自行决定 碎碎念 当时用的遗传算法脚本比这个要简陋得多,后来才做成这样一个“像仓库的样子”。不过用这个方法拿到了双榜前10,可能是因为大家都写MInimax算法,于是就变成调参比赛,这样的话能拿出遗传算法的思路感觉比手动调还是更有意思 评估函数设计中,整个过程共用一套棋盘位置权重参数是一个绊脚石,按道理来讲,前中后期用不同的参数效果理论上更好。如果AI还是继续以往年年下棋的作业,可以尝试一次性调更多的参数 本人没有学过OOAD,没有设计模式的概念,代码风格比较随意( GitHub View Github    

Read more

Continuous Security Group Rule Change Detection & Response at scale

Introduction Get notified of Security Group Changes across all AWS Accounts & Regions in an AWS Organization, with the ability to respond/revert those changes with a single button click from a Slack Channel.This is made easy and possible with the recent announcement of CloudTrail Lake, which helps aggregate CloudTrail logs from all accounts/regions in a queryable(if that’s a word :P) format. The infrastructure needed for this project is deployed as a CDK Application, which deploys a CodeCommit repository and a […]

Read more

Hitters Linear Regression With Python

Kullanacağımız veri seti Carnegie Mellon Üniversitesi’nde bulunan StatLib kütüphanesinden alınmıştır. Veri seti 1988 ASA Grafik Bölümü Poster Oturumu’nda kullanılan verilerin bir parçasıdır. Maaş verileri orijinal olarak Sports Illustrated, 20 Nisan 1987’den alınmıştır. 1986 ve kariyer istatistikleri, Collier Books, Macmillan Publishing Company, New York tarafından yayınlanan 1987 Beyzbol Ansiklopedisi Güncellemesinden elde edilmiştir. Salary yani maaş değişkeninini bu projede linear regression ile tahmin edeceğiz. Veri setini daha yakından tanımak adına değişkenleri tanıyalım: AtBat: 1986–1987 sezonunda bir beyzbol sopası ile topa yapılan vuruş […]

Read more

Raining Outside? Build a Weather CLI App With Python

You’re stuck inside because of torrential rains—again! You wonder what the weather’s like in that faraway city where your friends from the Real Python community live. You’d rather stick around in your command-line interface (CLI) than look it up in your browser. If that sounds like a task you’d want to tackle by building a command-line weather app using only the Python standard library, then this tutorial is for you. In this tutorial, you’ll learn how to: Build a functional […]

Read more

The fastest way to read a CSV in Pandas

You have a large CSV, you’re going to be reading it in to Pandas—but every time you load it, you have to wait for the CSV to load. And that slows down your development feedback loop, and might meaningfully slows down your production processing. But it’s faster to read the data in faster. Let’s see how. In this article we’ll cover: Pandas’ default CSV reading. The faster, more parallel CSV reader introduced in v1.4. A different approach that can make […]

Read more

Python client for MLflow REST API

Python client for MLflow REST API. Features: Minimal dependencies Unlike MLflow Tracking clientall REST API methods and params are exposed to user. MLflow URL is passed via constructor argument instead of env variable,so multiple client instances could be created in the same Python interpreter. Basic and Bearer auth are supported (via constructor args too). All class fields are validated with pydantic. All methods and classes are documented. Limitations: There is no integration with ML frameworks and    

Read more

An Alfred workflow to restore iTerm2 window Arrangements

This alfred workflow will list avaliable iTerm2 arrangements and let you select one to restore. Requirements iterm2: Build 3.4.15 (not tested on other versions but myght work) And the following python libraries: pip3 install iterm2 pip3 install pyobjc This workfllow will use the python from iterm2 on ~/Library/ApplicationSupport/iTerm2/Scripts/get_window_arrangements/iterm2env/versions/3.8.6/bin/python3 Usage Just type iTermA on alfred and it will: Launch iterm2 if its closed List the avaliable window arrangements Restore the selected window arrangement Download Check the releases page to download it. […]

Read more
1 256 257 258 259 260 929