GT CS 7280: Network Science Modeling Epidemics

深入大模型-52-Harness综述之(二)四大子系统 一个Harness都由四个子系统拼成,Agentic Loop是主干,四个子系统是Tool系统、Memory & Context、Guardrails,再加上一个把它们优雅组织起来的Skill系统。 阅读详情


GT CS 7280: Network Science
Assignment 4: Modeling Epidemics
Fall 2024
Overview
The objective of this assignment is to experiment with the concepts we covered in Module-4
about network epidemics, and see how the theoretical results that were derived in class
compare to simulation results.
Submission
Please submit your Jupyter Notebook A4-YOURGTUSERNAME.ipynb with requirements.txt
so that we may be able to replicate your Python dependencies to run your code as needed.
With Anaconda, you can do this by running:
conda list -e > requirements.txt
Ensure all graphs and plots are properly labeled with unit labels and titles for x & y axes.
Producing readable, interpretable graphics is part of the grade as it indicates understanding of
the content – there may be point deductions if plots are not properly labeled.
Getting Started
Assignment 4 requires Epidemics on Network python module available here. You can download
this module and run the examples given in the documentation to become familiar with it.
You can install the library using: pip install EoN
This homework, especially parts 2 and 3, might take several minutes to run. Be aware of
this and plan to complete it accordingly.
**IMPORTANT** As with prior assignments the structure has been designed
to have several subsections in each part. The first few subsections are
meant to just define useful functions and the final subsection of each part
is where the functions are called and the analysis is done. If you are
confused about how a function is meant to be used, check the final
subsection in each part to see how they are being called. This should clear
up a lot of potential points of confusion early on.
GT CS 7280: Network Science
Part 1: Outbreak Modeling [40 Points]
The file “fludata.txt” has the list of students, teachers and staff at a school. The interaction
between them was measured based on the proximity of the sensors that people were carrying
on them. The data file has three columns, the first two columns are the IDs of the people and
the third column is the number of interactions.
Construct an undirected graph from that text file using functions in the networkX module. For
the purpose of this assignment, we consider only the unweighted graph (i.e., you can ignore
the third column).
1. [10 points] Suppose there is a pathogen with transmission rate of 0.01 and recovery
rate of 0.5. Suppose that an outbreak started at node 325 (“patient-0”). Complete the
simulate_outbreak function to simulate an outbreak under the SIS model using the
provided parameters. The function should return a list of length n_iter containing
simulation runs where n_iter is an argument to the function.
Important: When running your simulations, you will want to discard the outbreaks that
died out stochastically. To do this, check whether the number of infected nodes at the
last time step is 0 and replace them with a simulation that does not die out. In total you
should have n_iter simulations.
Additionally, complete the plot_outbreaks function to visualize the results of the
simulate_outbreak function. Show the results for each of the simulations on a single
plot and break each simulation into 2 lines, one for the number of infected and the other
for number of susceptible over time. Make sure to properly label these lines and to
create a legend identifying which lines are which.
2. [10 points] In the lecture we modeled the initial exponential increase of the number of
infected nodes as 𝐼(𝑡) ≈ 𝐼 , where 𝜏 is a time constant. Note that here as only
0
𝑒
𝑡/τ
𝐼
0 = 1
one node was infected initially. Now, complete the get_exponent function to fit an
exponent to the curve of the number of infections. Choose only the initial portion of the
outbreak, say for 𝐼(𝑡) ≤ 100 (the exponential region of the outbreak, where the number of
infected is less than or equal to 100) and return the estimated time constant 𝜏.
Hint: scipy.optimize.curve_fit is a helpful function to fit the exponent to a curve.
Additionally, complete the plot_curve_fit function to plot both the actual number of
infected and the theoretical curve given a value of 𝜏 (for values of Infected < 100). This
function should also compute the r-squared between the two curves and print the value
for 𝜏 and r-squared in the title of the plot. Again, make sure to label both curves and
create a legend identifying which is which.
3. [5 points] In the lecture and textbook we discussed theoretical values for 𝜏 that can be
calculated from properties of the graph and the dynamics of the infection spread.
Complete the calculate_theoretical_taus function to compute:
GT CS 7280: Network Science
○ The random distribution shown in the Lesson 9 Canvas lecture “SIS Model”.
○ The arbitrary distribution from the Canvas lectures shown in the Lesson 9
Canvas lecture “Summary of SI, SIS, SIR Models with Arbitrary Degree
Distribution”.
○ The arbitrary distribution from the textbook found in Ch. 10, Equation 10.21.
Additionally, complete the compare_taus function to show a boxplot of the distribution of
sample 𝜏’s calculated from simulation runs (see 1.5 to understand where these come
from). Visualize the theoretical calculations as dots on the box plot. Again, label each of
these dots with the calculation used to generate them.
4. [10 points] Complete the calculate_theoretical_endemic_size function to compute the
size of the population that remains infected at the endemic state.
Then, complete the compare_endemic_sizes function to plot the distribution of
endemic sizes across several simulation runs as a boxplot, and compare it with the
theoretical calculation for endemic size as a single dot, similarly to the previous
subsection.
5. [5 points] Run the code provided in cell 1.5 and look at the resulting figures. How good of
a fit is the exponential curve in section 1.2? Explain how the theoretical estimates in 1.3
& 1.4 compare to the empirical distribution and indicate which you would consider a
reasonable fit for the data.
Part 2: Transmission Rate [25 Points]
Next, let us vary the transmission rate and see how it affects the spread of infection. Since we
know that only the ratio of the transmission rate and the recovery rate matters, let us keep the
recovery rate constant at 0.5 and vary only the transmission rate.
1. [10 points] Complete the simulate_beta_sweep function to vary the transmission rate
over a range of beta values between beta_min, beta_max with beta_samples number of
points. For each value of the transmission rate, compute 5 simulations to avoid outliers.
You can reuse your simulate_outbreak function from Part 1 in this function.
Next, complete the extract_average_tau function to return a list of the average 𝜏 value
calculated over the five simulation runs for EACH beta value. You may reuse the
get_exponent function from Part 1.
Finally, complete the plot_beta_tau_curves function to show the exponential curve
given by the 𝜏 values for each beta value. The x-axis is time and y-axis is the number of
infected people. Use a log scale on the y-axis and make sure that each line has its own
color. This function should be similar to the plot_curve_fit function in part 1.2, but you
GT CS 7280: Network Science
will be showing a series of exponentials instead of comparing an experimental with a
theoretical curve.
2. [10 points] Complete the extract_average_endemic_size function to return a list of the
average endemic size calculated over the five simulation runs for EACH beta value.
Next, complete the calculate_theoretical_endemic function to find the minimum
theoretical beta values of the transmission rate for an epidemic to occur. Calculate this
minimum based on the equations derived in lecture for both the random distribution and
the arbitrary distribution. Also, calculate the theoretical endemic size for each value of
beta under the assumption of random distribution.
Finally, complete the compare_endemic_sizes_vs_beta function to plot the average
endemic sizes and theoretical endemic sizes as a curve vs beta. Additionally, plot the
minimum values for beta to start an epidemic as vertical lines. Make sure to label each
line and provide a legend.
3. [5 points] Run the code provided in cell 2.3 and look at the resulting figures. How similar
is the theoretical to experimental endemic sizes? How closely do the minimum beta
values provide a reasonable lower bound for the start of an endemic?
Part 3: Patient-0 Centrality & 𝜏 [30 Points]
Now, let us see how the choice of “patient-0” affects the spread of an outbreak. Consider every
node of the network as patient-0, and run the SIS model using the parameters in Part 1 to
compute . Run the simulation with each node in the simulation as patient-0. Hint: You can skip
cases where the infection quickly diminishes to 0.
1. [10 points] Complete the sweep_initial_infected function to complete a single
simulation run for each node in the graph as the initial infected. Check for runs that
stochastically die out and do not save those. Return the list of simulation run results and
a list of nodes (integer IDs) where the simulation was successful.
Additionally, complete the compute_centrality function to calculate the: degree
centrality, closeness centrality (with wf_improved=false), betweenness centrality, and
eigenvector centrality of the graph. Remember to use the unweighted centrality metrics.
Return the centralities for each node where the simulation was kept in the previous
function.
Hint: We provide “nodes” as an argument which is meant to represent the second output
of the previous function. You can use this to filter for centralities of only these nodes
before you return them. Check the cell for 3.3 to see exactly how this is used.
GT CS 7280: Network Science
2. [15 points] Complete the calculate_pearson_correlation to compute the Pearson
correlation coefficient between each centrality metric and 𝜏, along with a p-value for that
correlation.
Additionally, complete the plot_centrality_vs_tau function to plot a scatter plot between
the 𝜏 value that corresponds to each node, and different centrality metrics of that node:
degree centrality, closeness centrality, betweenness centrality, and eigenvector
centrality. Do this all as one figure with four subfigures. Include the Pearson correlation
values as well as the corresponding p-values in the title for each scatter plot. Remember
to use the unweighted centrality metrics.
3. [5 points] Rank these centrality metrics based on Pearson’s correlation coefficient, and
determine which metrics can be a better predictor of how fast an outbreak will spread
from the initial node. Analyze your results. That is, do the results match your intuition? If
they differ, why might that be?
Part 4: Knowledge Question [5 Points]
Answer the following food for thought question from Lesson 10 – Submodularity of Objective
Function:
Prove that a non-negative linear combination of a set of submodular functions is also a
submodular function.
Hint: Make sure you understand the definition of linearity.
 

大彩串口屏+LUA避坑指南:从Flash读写到控件状态配置的5个常见问题 本文针对大彩串口屏的LUA脚本开发,深度剖析了Flash数据存储与控件状态配置中的5个常见陷阱。重点讲解了如何通过标志位安全初始化Flash、正确处理多字节数据转换,以及如何精准配置按钮与文本控件的状态与事件响应,帮助开发者提升开发效率与代码可靠性。 阅读详情

相关推荐

超声波清洗机拆解实录:从电路板到换能器,一文看懂内部构造(附高清图)

本文详细拆解了超声波清洗机的内部构造,从电路板设计到换能器工作原理,揭示了其核心技术。通过高清图片和详细分析,展示了功率放大电路、高频变压器及压电换能器等关键部件,为电子爱好者和维修技术人员提供了实用的故障诊断和元件二次利用指南。

grape的博客 1194

Python+Agent入门笔记(六):记忆和状态,从“一次性问答”到“能用助手”

滑动窗口的缺点很明显:被扔掉的信息就真没了。如果用户第一轮说“我不吃辣”,隔了二十轮让他推荐餐厅,模型已经忘了。定期把旧的对话压缩成一段总结,作为一条特殊的消息插进去。"""把除 system 和最近 keep_recent 条以外的消息,压缩成一条摘要。返回新的 messages 列表。"""# 把旧消息拼成纯文本,让模型总结content = f"[工具结果]把除 system 和最近 keep_recent 条以外的消息,压缩成一条摘要。返回新的 messages 列表。

qq_41241612的博客 115

LuaJit分析(十一)去除string.dump函数

因此即使我们的指令顺序被打乱,通过loadfile系统调用,再通过string.dump调用,可以得到字节码文件,再通过与标准的luajit生成的字节码文件比对,即可找出差异所在。Lua脚本中的string.dump函数用于生成字节码文件,根据对 luajit -b命令的分析可以得出,最终dump出字节码文件都是使用的string.dump函数。同时lj_libdef.h和lj_ffdef.h这两个文件都是自动生成的,在msvcbuild.bat中,使用如下命令生成。

a545958498的博客 1134

循环嵌套(多层 for 循环)

表:order(订单表,order_id, user_id)、user(用户表,user_id, user_name)✅ 优化:先查所有订单,拿到所有 user_id 批量 in 查询,内存 join。✅ 优化:先把优惠券转 HashMap,单层循环查找(hash 查找 O (1))SQL 只有 2 次,O (1) 数据库查询,内存遍历 O (n)。需求:查询所有订单列表,同时带出每个订单对应的用户名称。需求:订单列表、优惠券列表,把订单匹配对应的优惠券名称。复杂度:O (M+N),非常快。

weixin_43732943的博客 229

Sentinel2 哨兵2数据下载方法(USGS)-史上最全讲解

本文讲述了从USGS官网下载Sentinel2的方法。主要包括USGS官网的注册和下载流程,以及选定研究区中所出现的问题、解决办法。

xiatiandexia123的博客 6万+

更新3ds时和用读卡器读取传输文件操作不当导致的tf卡损坏无法读取需要格式化时出现的问题以及不想丢失文件并且修复的详细解决方法

前言: 不小心按了同意更新而且tf/sd卡损坏导致了3ds打开后都是出现 Anerror has occurred:(红色的) Failed to apply 1 FIRM patch(es). Press any button to shotdown 这样的画面,按了任意键后就关机,我找了很多资料和大佬的回答解决了这些问题,现在记录一下。 一.不小心按了更新导致上述的画面 原因:是因为系统升级了,但是里面的Luma3DS还没有更新,属于是更新了但没有完全更新的状态。 **修复方法** 1.首先请按

give_me_fish的博客 1万+

【数据结构-5】单链表的实现

单链表,具体来说是单向的、不带头的、不循环的链表。链表由一个一个节点组成,每个节点分为数据域和指针域,数据域存放数据,指针域存放下一节点的地址。这样,就可以根据指针域中的地址找到下一个节点,节点就串起来了构成了单链表。

a bit 219

ATAC-seq差异分析实战:从原始数据到GO富集(R/Bioconductor全流程)

本文提供了ATAC-seq差异分析的完整R/Bioconductor实战流程,涵盖从原始数据准备、一致峰集构建、计数矩阵生成,到使用DESeq2进行差异可及性分析,以及差异峰的基因组注释与GO富集分析。文章详细讲解了关键步骤、参数设置和常见问题,旨在帮助研究者获得可靠且可解释的生物学结果。

weixin_29246195的博客 232

C# 数据结构和特殊类型

.NET Core(现称.NET)提供丰富数据结构,优化性能与开发效率。日常开发首选List<T&gt;和Dictionary<TKey,TValue&gt;;高性能场景推荐Span<T&gt;与Memory<T&gt;减少内存分配;并发环境使用ConcurrentDictionary等线程安全集合;避免非泛型集合如ArrayList。

cccloveforever的博客 765

2025年7月5日全国青少年信息素养大赛图形化(Scratch)编程小学低年级组复赛真题+答案

2025年7月5日全国青少年信息素养大赛图形化(Scratch)编程小学低年级组复赛真题+答案

伶俐角少儿编程 901

保姆级教程:如何将仅限客户端使用的免费大模型(Gemini、Antigravity、Qwen Code、Kiro 等)转为任何应用可调用的 OpenAI 兼容标准接口

大模型 API 费用太贵?💸 这篇文章分享一个薅羊毛神器,能把 Gemini、Qwen Code、Kiro 等客户端专属的免费大模型转换成标准 OpenAI 兼容接口 🔌。支持多协议互转、账户池管理、Web 管理界面,Docker 一键部署,零成本调用 Claude Opus 4.5、Gemini 3 Pro 等高级模型 ✅

XiaoqiangClub的博客 1038

C++ 入门笔记(十七):list 入门 —— 为什么 list 不能 sort?

第17课:用大白话讲清 list 的双向链表结构、哨兵头、push_back 四步、迭代器封装、merge 与 splice 的区别,以及 vector 排序为什么常比 list 快。

wo_jack的博客 266

手把手教你安装 OpenClaw 小龙虾(MAC安装教程),一次成功不踩坑

本文详细介绍了在Mac上安装OpenClaw的完整流程。主要内容包括:1)准备工作(磁盘空间、网络环境、终端工具);2)安装Homebrew包管理器及常见问题解决;3)安装Node.js 22+版本(环境核心);4)Git安装与验证;5)OpenClaw项目克隆、依赖安装及运行配置;6)大模型配置方法(以MiniMax为例)。文章提供了详细的命令行操作步骤和常见错误解决方案,特别强调了网络环境要求和Apple Silicon芯片的原生支持注意事项。最后展示了验证配置成功的方法和资源获取渠道。

Chengbei11的博客 6348

软件商店常见问题标准处理流程

从底层软件源来看,/etc/apt/sources.list配置错误、源地址失效、公网与内网离线源混用、ARM64与x86_64架构源串用,以及DNS解析异常、系统代理配置错误,都会导致商店无法获取应用数据;打开该应用,确认可正常运行;软件商店作为系统内置的图形化软件分发与安装入口(UKUI桌面配套组件,底层依赖APT软件源),承担着应用软件的浏览、搜索、下载、安装、升级与卸载等核心功能,是终端软件部署与管理的关键通道。覆盖软件商店启动、页面加载、应用下载、安装、卸载、搜索、自身更新等全部业务场景。

qq_39496637的博客 318

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

【AI 开发从入门到进阶 · 10】收官篇:LoRA 微调、模型评估、推理加速与生产部署全链路

本文系统梳理了大模型微调与生产落地的全流程,从决策是否微调、优选LoRA技术方案,到代码实现、效果评估、推理加速与FastAPI服务封装,最终构建可迭代的生产级AI系统。强调“逐级升级”原则,倡导以数据闭环驱动优化,避免技术冲动。全系列贯穿工程化思维,提供可复用模板与实战建议,助力开发者从模型训练迈向稳定可用的AI服务部署。

信息安全领域优质创作者|操作系统领域专家 138

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

LangGraph(03):状态归约、并行更新与消息管理

并行节点写入报错?历史消息无法清理?本文拆解 LangGraph 状态归约与消息增删改机制,带你精确控制复杂工作流状态。

专注于 Agent 工程、AI 产品、Harness Engineering、LLM 算法等方向,OpenMathModel、Nivik 等开源项目作者 169

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

ARIA规范

ARIA用来补充原生HTML缺失的语义,原则:优先原生标签,ARIA仅做补充。 ARIA角色role:定义组件身份,分为地标角色、构件角色、文档角色;构件角色用于自定义弹窗、tab、下拉菜单等复杂组件; ARIA状态与属性:以aria-开头,描述组件实时状态;常用:aria-label、aria-labelledby、aria-describedby、aria-hidden、aria-expanded、aria-selected、aria-modal、aria-live; 常用场景:图标按钮用aria-l

2401_83227843的博客 480

LangGraph 的分离思想总结

LangGraph 的分离思想,本质上是对"高内聚、低耦合"这一经典工程原则在 LLM 应用领域的落地。它通过状态与逻辑分离、节点职责分离、控制流与执行分离、计算与持久化分离、编排与实现分离五个层面,把一个难以维护的"大黑盒"拆解成一组可组合、可测试、可观测的部件。理解这套分离思想,比记住 API 更重要——因为当你面对新的智能体场景时,真正指导你做出合理拆分的,正是这些分离原则。

张晨光老师的播客 423

ArrayList 与 LinkedList 的区别:原理、性能与选型指南

ArrayList是默认选择,LinkedList只在特定场景(已知节点位置的频繁增删、需要双端操作)才有优势。理解底层结构,才能在实际开发中做出合理选型。

2601_97279490的博客 329

Java基础:泛型、类型擦除与 PECS 原则

泛型允许类、接口和方法使用类型参数,把许多类型检查提前到编译期,减少显式类型转换,提高代码复用性。例如。

cjpabc的博客 465

To-Do List 的「修改」功能与 CSS 定位

买牛奶</td><td index="1">写作业</td><td index="2">跑步

2401_89953644的博客 327

LikeShop 取消订单优惠券自动退回二开:未支付取消券自动返还,不用人工补发

本文分析了LikeShop订单取消时优惠券退回机制的原生缺陷,提出通过引入独立事务、退回流水表与三重幂等防护,实现券退回的可追溯、防重复、防过期。核心策略为:订单取消后异步触发退券事件,基于条件更新与唯一约束保障并发安全,过期券不退回但记录跳过原因,确保用户体验与系统一致性。

每天分享不同的文章 357

Java Arrays.asList 常见坑详解|UnsupportedOperationException、数组联动、基本类型 bug

解析 Arrays.asList 常见开发陷阱,演示 UnsupportedOperationException、底层数组引用共享、基本类型数组问题,区分 Arrays 内部 ArrayList 与 java.util.ArrayList,给出数组转 List 的各种场景正确代码。

weixin_42617033的博客 511

C++11_list类复习

C++ list 采用带头结点的双向循环链表实现,迭代器仅支持双向遍历(++、--),不支持随机访问(如 +n、<)。因链表节点分散存储,无法通过指针算术快速定位,故 std::sort 等算法要求随机访问迭代器,无法作用于 list。list 自带 sort() 成员函数,利用其双向迭代器特性高效排序。虽插入删除为 O(1),但查找位置需 O(n),且缓存不友好,实战中常不如 vector。推荐默认使用 vector,仅在频繁插入删除且已知位置时选用 list。

lemo_n_的博客 306

本地chatbot4--引入LangGraph

上一节实现了chatbot的连续调用工具的功能,但目前流程还是提示词→模型→解析→调用工具(可选)→输出线性的一条路走到底(LangChain)只适合简单线性任务(问答、摘要、简单RAG)agent的本质是:“模型决定调工具→执行→结果喂回模型→再决定……直到完成”。举例:读日志 → 解析 ─失败→ 重试(≤3次) ─→ 退出│成功↓算统计 → 对比历史 → 生成报告 → [人工审核卡点] → 发送。

weixin_45859446的博客 109

上万数据的批量插入

当数据达到上万上十万的时候,如何批量插入

junxunfs的博客 51
上一篇: MessagePassing Interface (MPI)
下一篇: MU5IN160 – Parallel Programming
wx____codinghelp
博客等级 码龄2年 771粉丝 115原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值