自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 收藏
  • 关注

原创 heroku django部署

【代码】heroku django部署。

2024-02-27 02:19:28 343

原创 [RL] 深入理解Tabular Leaning (MC/TD) 过程中的梯度下降使用

深入理解Tabular Leaning过程中的梯度下降使用:i.e. Tabular Leaning:TD/MC/DP梯度下降: GD/SGD/Semi-GD在强化学习中,众多Tabular算法均需要通过梯度下降来获取optimal weight (finding the global optimal point),从而在Function Approximation(函数拟合学习)过程中更好的对value/policy进行更新。一般情况下,我们在MC情况下使用SGD (效率远高于GD),而我们对

2022-04-19 11:58:39 421

原创 [SoftwareEngr] Design Pattern Refactoring 设计模式重构全解

Reference:https://refactoringguru.cn/design-patterns/catalog

2022-03-29 09:55:36 178

原创 [Python-Numpy] 转换Dictionary/Dict Array为Numpy Array

import numpy as np # Creating a Dictionarydict = {1: 'Geeks', 2: 'For', 3: 'Geeks'} result = dict.items() # 此处可根据情况选择.values or .keysdata = list(result)numpyArray = np.array(data)

2022-03-29 09:52:38 1829

原创 [RL] Expected Sarsa Algorithm (in Python)

Numpy importedExpected Sarsa在Grid问题中的应用class ExpectedSarsaAgent(BaseAgent): def agent_init(self, agent_init_info): """Setup for the agent called when the experiment first starts. Args: agent_init_info (dict), the pa.

2022-03-07 05:43:46 401

原创 [RL] Q-learning Algorithm (in Python)

numpy importedQ-learning 在Grid问题下的应用class QLearningAgent(BaseAgent): def agent_init(self, agent_init_info): """Setup for the agent called when the experiment first starts. Args: agent_init_info (dict), the parameter.

2022-03-07 05:40:25 413

原创 [Android] RobotiumTest跨Activity执行UI Test

基于Robotium Solo执行迭代式跨Activity UI Test:// 执行点按操作进入ActivityB;// ActivityA --> ActivityB --> ActivityC// 在ActivityA执行:if (solo.waitForActivity(ActivityB.class)) { // 在ActivityB执行:检查是否位于ActivityB,检查是否存在信息"Info"等测试; solo.assertCurrentActivity("W

2022-03-04 11:12:59 1193

原创 [Android] 新创Activity模板

import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;public class ShowActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(sav

2022-03-04 10:13:11 2322

原创 [Android] 基于Intent实现Activity间跳转与传参 (in Java)

首先,在当前活动(ActivityCurrent)内初次创建intent:使用putExtra(“Key”, Value) 置入携带参数;执行startActivity()使新活动页面激活;//* In ActivityCurrent:// 基于双参数创建Intent Object,参数为(当前活动,目标活动);Intent intent = new Intent(ActivityCurrent.this, ShowActivity.class);// 传参准备,分别塞入一个string和i

2022-03-04 10:07:14 1730

原创 [Android] RobotiumTest解决Solo.clickOnButton()无法工作

本来使用clickOnButton(“Text”)来找button,有的机器上可以正常工作,有的却不行,似乎取决于你的安卓手机系统是否为旧版;尝试使用id定位button,但clickOnButton依旧无效,其并非是不点按,而是一运行便点按,不按正常逻辑运行;最终解决方法:将clickOnButton()替换为clickOnView(),并使用id定位: solo.clickOnView(solo.getView(com.example.test.R.id.your_view));...

2022-03-04 07:50:29 1382

原创 [Firebase] 删除Collection中Document (in Java)

// db.collection("CollectionName").document("Documentname") .delete() .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void

2022-02-11 13:02:58 1301

原创 [Firebase] 创建Collection & Document (in Java)

// 创建数据库索引变量dbdb = FirebaseFirestore.getInstance();// 创建数据库collection Citie,添加索引索引变量final CollectionReference collectionReference = db.collection("CollectionName");// 创建哈希变量,准备数据用于doc的property填充HashMap<String, String> data = new HashMap<>

2022-02-11 12:42:57 1364

原创 [Android] ListView条目监听器搭建 (in Java)

// 在layout通过id定位目标元素listview:listViewName = findViewById(R.id.listViewID);// 对此目标元素搭建监听器:listViewName.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent,

2022-02-11 11:29:35 1490

原创 [SoftwareEngr]UML制图工具

UML绘制:https://online.visual-paradigm.com/app/diagrams/#G17LuVyqEV3lA_UP2vppokI0OIsrdcxcdG更多UML语法后期更新

2022-02-05 10:47:45 244

原创 【Notes】数据常用操作随笔

本人曾粗略学过numpy核心语法以及python的数据操作,但是奈何许久不写python了,并且np所学真到用时却不知很多功能如何实现。借此原因创建随笔,更新做Optimization过程中遇到的常用功能表达(py/py_np/RL/ML)。*列出仅为常见用法,更多见Google1/ np.argwhere(关于矩阵筛选条件) np.argwhere(X >1)Return:返回该矩阵下符合此条件的元素序列格式为数组:(1D --> 一阶数组)[x, y, z](2D --&g

2022-02-05 10:26:27 1088

原创 [Java] (Forward) SimpleDateFormat获取特定格式时间

Reference: http://tutorials.jenkov.com/java-internationalization/simpledateformat.html

2022-02-03 12:56:58 722

原创 [Android] (Forward) view模块下的Visible/Invisible切换操作

Reference:https://stackoverflow.com/questions/8504712/displaying-user-input-after-button-press

2022-01-21 16:41:58 147

原创 [ML] Genetic Algorithm 理论概述

Genetic Algorithm 遗传算法:遗传算法受到达尔文自然选择理论的启发,以遗传/变异/择优的策略进行机器学习进程。核心算法逻辑:# Copyright:CMPUT 296, University of Alberta# Pseudocode 伪代码population = initialize populationSize random pointstime = 0while avg or best (F(population))<threshold and time<

2021-11-30 00:00:00 88

原创 [ML] Clustering Analysis 中的 Elbow Method 肘子方法

处理多个肘子出现的情况:当出现多个Possible Elbows时,除直觉外,优先选取更靠近“过度拟合”的肘子。如图,此处cluster->k=6 优于 k=3。肘子方法的定义参考Wikipedia,其主旨在于聚类选取k值时避免“过度拟合”出现,并且在扭曲/失真允许的范围内尽可能优化数据模型。Definition:https://en.wikipedia.org/wiki/Elbow_method_(clustering)Reference:https://blog.csdn.net

2021-11-16 02:31:51 1421

原创 [C#] (Forward) List Copy

转载:https://www.cnblogs.com/zhang1f/p/13187724.html

2021-11-14 20:54:49 110

原创 [GameAI] A* Algorithm拓展Heuristic Function (启发式函数)

About the Heuristic Func Based on A Algorithm*Reference: https://www.cnblogs.com/Leonhard-/p/6842052.html

2021-10-04 19:49:12 114

原创 [Linux] 文件 Modified/Created Data 修改

已知适用于MacOS,Linux未测试touch -m YYYYMMDDhhmm /File/Address/... # 修改modified datetouch -t YYYYMMDDhhmm /File/Address/... # 修改created datetouch -t YYYYMMDDhhmm /File/Address/... # 同时修改两者e.g.YYYY --> 2020MM --> 01DD --> 01hh --> 23mm --&

2021-06-18 18:11:31 292

原创 [C/C++] 随机数获取发生器

/* 随机数获取 */ int index, amounts = 1024, randomDirect[amounts]; time_t t; srand((unsigned) time(&t)); // 初始化随机数发生器 for (index = 0 ; index < amounts; index++) { randomDirect[index] = rand() % 4; // 创建0-4之间的1024个随机数 }...

2021-04-25 20:31:21 74

原创 [C/C++] Array of Pointers to Strings 指向str array的多级指针数组

int main(){ char *week[3] = {"aaa","bbb", "ccc"}; char **ptr = week; printf("%c\n", *ptr[0]); // 打印ch, OUPUT: aaa printf("%s\n", ptr[0]); // 打印str, OUPUT: a *ptr[0] = "0"; ptr[0] = "ddd"; printf("%c\n", *ptr[0]); // 打印ch, OUPUT: 4dd printf("%s

2021-03-23 16:00:01 93

原创 [C/C++] 通过单循环双指针线性遍历2D数组

单循环+双指针以线性模式遍历2维数组取和 Sample:#include <stdio.h>#define LEN 10int sum_two_dimensional_array(int a[][LEN], int n){ int *p1 = *a, *p2 = *a; int sum = 0; for (; p1 <= p2 + 19; p1++) { sum += *p1; } return sum;}int

2021-03-08 23:54:59 113

原创 [C/C++] 通过scanf() 函数读入含空格信息

通过识别\n换行符来确定是否结束读入。printf("Enter a message: "); scanf("%[^\n]", input);

2021-03-08 23:17:49 468

原创 [GeneralAlgorithm] Binary Tree Algorithm 单链表算法 (in Python)

Binary Tree Algorithm (in Python)简易二叉树算法,包含可视化打印,附三类顺序表达和额外查找方法。最后一部分代码用以根据两种 data orders (inorder & preorder) 识别并创建Binary tree object.class BinaryTree: def __init__(self, rootElement): self.key = rootElement self.left = None

2020-12-01 12:59:12 142

原创 [GeneralAlgorithm] Stack Algorithm 栈算法 (in Python)

Stack Algorithm (in Python)栈算法,携Sample Test部分class Stack: def __init__(self): self.items = [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self):

2020-12-01 12:51:33 107

原创 [GeneralAlgorithm] Bounded Queue Algorithm 有界队列算法 (in Python)

Bounded Queue Algorithm (in Python)简易有界队列算法,携Sample Test部分class BoundedQueue: def __init__(self, capacity): assert isinstance(capacity, int), ('Error: Type error: {}'.format(type(capacity))) self.__items = [] self.__capacity

2020-12-01 12:35:46 170

原创 [GeneralAlgorithm] Circular Queue Algorithm 循环队列算法 (in Python)

Circular Queue Algorithm (in Python)简易循环队列算法class CircularQueue: def __init__(self, capacity): """ Constructor, which creates a new empty queue. """ # Check validity of capacity type and value if type(capacity)

2020-12-01 12:35:08 83

原创 [GeneralAlgorithm] Single-linked List Algorithm 单链表算法 (in Python)

Single-linked List Algorithm (in Python)简易单链表算法,携Sample Test部分class SLinkedListNode: def __init__(self, initData, initNext): self.data = initData self.next = initNext def getNext(self): return self.next def getData(s

2020-12-01 11:15:16 82

原创 [GeneralAlgorithm] Double-linked List Algorithm 双链表算法 (in Python)

Double-linked List Algorithm (in Python)简易双链表算法,部分功能待补充。class DLinkedListNode: def __init__(self, initData=None, initNext=None, initPrevious=None): self.data = initData self.next = initNext self.previous = initPrevious

2020-12-01 11:08:48 105

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除