💡 所思所感

    💡 所思所感
    关于理发💇🏻‍♂️
    有时候会拖着不去理发,其实是对应着情绪不高,状态不好,拖延症犯的时候。所以我更愿意把理发当做是一次改变,剪断过去的烦忧,扫除心中的杂念,给自己一个全新的心情与状态。

    要做到每月一剪,每月一改变,每月一总结,每月一焕新。

    💡 所思所感
    之前觉得,每天规划好每天的计划就行,但是这半个月看来,似乎效率非常低,每天规划每天的计划,变成了能拖就拖的感觉,而且极具短视性,从今天开始,每天开始规划三天的计划,并且严格按照计划落实完成。三月份试行,说到做到。

    🕳 踩坑 💡 所思所感
    C++跑起来内存一直增长怎么办?大概率是内存泄漏,使用Valgrind可以检测内存泄露的问题:

    Ubuntu:

    安装Valgrind:
    sudo apt-get install valgrind检测内存泄漏(确保你的程序是带调试信息编译,gcc编译时 -g)
    valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=./log.txt ./your_program

    --leak-check=full:进行内存泄漏检测并给出每个泄漏的详细信息。
    --show-leak-kinds=all:报告所有类型的内存泄漏。
    --track-origins=yes:跟踪未初始化值的来源,有助于发现使用未初始化内存的错误。
    --log-file=./log.txt: 日志信息

    🕳 踩坑 💡 所思所感
    output_file << i << "\t" << new_datum->points[i][0] << "\t" << new_datum->points[i][1] << "\t" << nodefit[i] << "\t" << id_belong[i][1] << "\t" << normal[i]?1:0 << std::endl;

    这句代码有什么问题?

    🕳 踩坑 💡 所思所感
    昨天碰到了一个严重影响算法性能的问题:在动态优化中,多样性的增强很重要,用于应对动态的变化,而当种群收敛时可以看作多样性的缺失。种群在收敛时(半径小于阈值)会被休眠,而触发多样性调整时会唤醒种群,我在此犯了个大错,我底层使用的是PSO,计算种群的半径用的是PSO的pbest到其中心点的距离的平均值,这就导致在种群唤醒时,虽然在其solut上做了布朗运动(扰动,增加其多样性),但由于其pbest基本不变,导致种群半径依旧不变,进而导致种群就算被唤醒,也会由于下一代的半径也符合收敛条件而被立刻休眠,导致根本无法应对环境的变化。所以,使用solut来计算半径,更加合理,当唤醒时,solut会被扰动,此时种群半径已无法再满足休眠条件,进而开始搜索,如若环境没有变化,则很快就会进入收敛状态,如若环境发生变化,亦可迅速响应,追踪新的全局最优解。

    此外,还遇到了一个问题:在比较两个解的dominate的时候,发现有一个解居然objective.size()居然为0,初步想法是没有被评价,但不对啊,没有评价objective.size()也应该是1,只不过适应值为0,后来又想是不是构造的时候出问题了,翻来翻去,发现我也只用了一种构造函数,是一定构造了objective信息的,后来经过调试仔细观察,发现其使用了引用,而其引用的对象objective.size()居然是470,非常令人匪夷所思,询问了大师兄,发现问题是这个解变成了野指针,在某个地方释放了,因为使用的是引用,所以此处所引用的对象自然不存在了,我推断时m_his_sols与ssp.his_sols引用的是同一个份解,m_his_sols中解被removeoutdated之后,而恰巧ssp.his_sols中未被移出,所以才导致了这个问题,预想的解决办法第一种是对m_his_sols操作后,同时对所有的ssp中的his_sols进行更新;第二种就是确保对m_his_sols进行淘汰时,同步淘汰ssp.his_sols中的相应的个体,现在是通过评价时间控制的,淘汰m_his_soks中大于evaltime的粒子时,并未正确淘汰掉对应ssp中his_sols超过evaltime的粒子,导致了粒子消亡后,还存在ssp列表中,算法更新每个ssp列表中best solut时,索引到了这个已经被释放的个体,导致出问题。这只是分析,明天再看看具体什么情况。

    💡 所思所感 这个阶段下的时间不多了,做好自己该做的事情,不要被外物所扰,像师兄们学习,多务实,多讨论

    💡 所思所感 最近在做一个自己的私有网盘,并定时备份自己的博客,同步自己的手机相册,有几个感受。

    这个网盘本质上就是用自己的pc开了个cloudreve服务,通过自己的常州服务器内网穿透暴露在公网,上传下载都经过常州服务器对流量转发至自己的pc,上传下载速度同时受限于pc的带宽和云服务器的带宽,比如上传一个文件,需要先请求常州服务器,这个就受限于下行(相当于服务器下载你喜欢的东西)和上传者的上行,转发的时候,相当于常州服务器充当上传者,而pc则是下载常州服务器上传的东西,中转了一次,受制于多方,如果pc有公网ip,那直连就只受制于pc的上下行了。同时以pc开网盘服务,有一个很大的缺点,我这个pc的功耗非常大,24小时开着,真是吃不消而且win11哪有服务器系统稳定,动不动就寄…偶然间看到了nas(网络存储服务器)这个东西,真是打开了新世界的大门,在考虑是不是得捡垃圾搞个玩玩…

    💡 所思所感
    最近买了两台小厂云服务器,一个是国内的一个是香港的,价格虽然相比阿里云这些大厂要便宜,但是说不定哪天就跑路了,着实是有点害怕,虽然数据每天都在做备份,但还是禁不住想自己捣鼓及一个物理服务器。看了半天觉得华为的RH2288Hv2就感觉不错,那么问题来了,公网IP怎么办?服务器放在哪?思考了半天,感觉时机还是不太成熟,等毕业了再考虑吧😔

    🌃 每日总结 💡 所思所感
    2024-07-02

    今日早上起床稍晚,明日需改正!今日晚上骑行运动了,骑了大概22km,体力没有之前经常运动那么好了,还是要坚持运动。本周运动指标达成1/2!老师早上发了一条消息,强调写论文:"每个段落第一句话交代主题、论点,后面在解释,表达要具体明确。 仔细琢磨每个段落之间的逻辑性和段内的逻辑性。",想想也确实是这样的,根据老师的意见我大致修改了introduction的内容和proposed framework的部分内容。

    在Introduction中:
    提出两个关键科学问题:搜索会有盲目性及后果(重复搜索某一个区域),种群的搜索范围未与峰的形状适配及后果(峰的丢失,后面补充过大/过小的搜索范围的存在的问题)。
    Traditional multi-population algorithms rely on the current state of each population to make decisions. This approach clearly has limitations, for two reasons:
    \textbf{1) the search process of a population involve a high level of blindness, leading to repeated search in the same region.}
    The population is only regenerated randomly, and the re-evolution process may converge to regions that have been searched before, resulting in redundant search of the same area.
    \textbf{2) The search range of each population does not adapt to the shape of the peaks, causing the loss of peaks that are tracked}.
    If the search range is too large, small but crucial local optima may be missed. Conversely, if the search range is too small, exploration may be limited to nearby areas, reducing population diversity.

    引出我们自己的研究方法,细节更详细的补充了,包括吸引域的估计使用了什么样的信息,不是简单的说使用历史信息,用什么方法估计的吸引域。
    To address the aforementioned issues, this paper proposes a multi-population framework for solving dynamic optimization problems based on space partition (MPFD). The algorithm partitions the solution space using a k-d tree, dividing it into a user-defined number of subspaces. Each subspace is assigned an uncertainty attribute; the higher the uncertainty of a subspace, the greater the probability that the algorithm will conduct searches within it. During the evolution process of multiple populations, the algorithm records the evolutionary information within each subspace, including the positions and fitness values of individuals. The algorithm fully utilizes this information by employing a subspace clustering method to group subspaces into basins of attraction (BoAs)\cite{baketaric2021attraction}. Based on these BoAs, mechanisms for exploration and exploitation are proposed. Additionally, a dual-layer exclusion mechanism and a population hibernation mechanism are introduced to save computational resources.

    在Proposed Framework中:
    第一句话总起本段,提出想法:可以从什么样的历史数据中学习什么样的问题结构,能解决什么样的问题
    The characteristics of the problem can be learned from the historical data of the evolution. During the evolution process, populations accumulate valuable historical data, including the positions and fitness of individuals. If we can extract the structural characteristics of the problem, such as the number of peaks, their locations, and their BoAs, from these historical data, we can guide the algorithm to sample within the learned better regions (e.g., the subspace where BoA is located). This increases the likelihood of finding better solutions more quickly. Additionally, we can quantitatively control the algorithm's exploration and exploitation in different regions, significantly reducing the issue of blindly repeating searches in certain areas.

    第二段提出了本文"从什么样的历史数据中学习什么样的问题结构"的具体做法:本文基于上述想法,是通过种群在子空间中遗留的个体位置和适应值信息,通过子空间聚类的方法,学习BoAs,是如何解决前面提出的两个关键科学问题。
    This study leverages historical data from population evolution, including the positional distribution and fitness information of individuals within the population. By employing subspace clustering method, BoAs of the problem are estimated. Based on these BoAs, the search behavior of the population is controlled. Specifically, areas outside the BoAs are explored to identify any undiscovered peaks, while exploitation is performed within the BoAs to enhance search precision. This approach overcomes the issue of blind repetitive searches found in traditional methods. Additionally, by precisely quantifying and controlling the search range according to the BoAs, the success rate of peak tracking is increased.

    第三段,综合上述两段提出的思考,提出本文的研究方法,总体介绍本文的研究方法。引出下文。也是按照总起句,然后解释的方式,行文中间也着重关注了逻辑和细节(比如利用什么信息?什么方法估计的吸引域?都详细的阐述了)

    Based on the above idea, this paper introduces a dynamic optimization framework based on solution space partition. The proposed framework first uses the k-d tree to divide the solution space into multiple subspaces. Then, multiple populations are generated based on subspaces, BoAs are estimated using the subspace clustering method, based on the historical information retained within the subspace, specifically the position and fitness of individuals within the populations. Exploration is conducted within the overlap regions, while exploitation is carried out within BoAs. Additionally, supplementary populations are generated within BoAs that are not covered by existing populations, in order to avoid losing track of peaks. To save limited computing resources, this paper proposes a dual-layer exclusion mechanism to prevent populations from repeatedly exploring the same region. Additionally, populations are put into hibernation when they converge. The detailed description for each component is given in the following sections.

    很难改,改的时候,感觉要思考很久,我觉得第一段和第二段还是稍微有一点点重复的地方,明天问问老师怎么改。