申明: 本博客内容为课程作业应答,理解上不一定正确,如您恰好看到该文档,请适量参考!作者对答案的正确性不负任何责任!
习题 1.1:{ 0 , 1 , { 0 , 1 } , { 1 , 2 } }有几个元素? 机器学习中, 这类形式的集合有什么优点和缺点?
- 以逗号为分割,本集合共有4个元素,分别是数字0、数字1、集合{0,1}、集合{1,2};
- 个人理解,在机器学习中,此类集合扩大了传统集合的定义约束,能够更宽泛地将多个类别的数据放到同一个集合中;同时,对于固定的输入参数如X,Y等,能够通过重组变形如X^2, XY等将更多参数带入学习网络,其为机器学习及输入等带来了新的入参及为网络训练提供更多支撑;能扩大网络分析问题的能力。缺点在于,多类型数据及重组可能带来信息的冗余,也为问题解决实现带来了一定的复杂度。
习题 1.2: ∅ 的基数是多少? { ∅ }呢?
- 空集∅,由于集合是空的,集合内不存在任何元素,所以其基数(集合内元素个数)是 0;
- { ∅ } 表示一个只包含空集的集合,集合内有一个元素是∅,所以其基数是1。
习题 1.3: 多标签学习中, 输出为一个向量,相应的学习器算不算函数呢?
- 个人理解,多标签学习是指,类似输入一张图片,然后输出该图片中所包含元素的标签,比如输入以下图片,则学习器能返回类似大海,大树,树根,地面,浪花,天空等标签。则对应某一个训练状态的学习器,同一个输入图片,学习器会返回一个表示各种标签的向量,而该向量所包含的信息应该是一定的,即对于同一个学习器,一个输入,只会对于一个输出。这符合函数的定义,所以学习器属于广义范围内的函数。
习题 1.4: 元组只能表达对象的数据部分, 还是可以完整地表达? 用一个具体的程序来说明.
- 万事万物皆对象,所以如果想要封装一定的东西,都应该能通过一定的方式形成一个具体的类,类中可以包含其后续实例的数据部分,也可以涵盖实例对象所涉及的操作。
- 在程序设计中,元组应该可以封装成一个类,不仅能表示实例对象的数据部分,也可以涵盖其相关的任何操作。如一个操作动作(方法),或者是不同对象间的泛化,包含或依赖关系。
// 以门上有锁为例,简单展示
public class Door{
private float len; // 长,此处演示对象数据
private float width; // 宽
private float height; // 高
private DoorLock lock; // 门上的锁, 此处演示包含其他对象
/*
* 给门换一把锁,此处演示对象相关操作
*/
public void resetDoorLock(){
// todo
}
// ……
}
public class DoorLock {
private String brand; // 品牌
private String model; // 型号
private int secLevel; // 安全等级
private int lockType; // 锁类型
// ……
}
习题 1.5: 定义二叉树.
直接引用老师的最新定义:https://blog.csdn.net/minfanphd/article/details/116582678
习题 1.6: 定义带权无向图.
Definition . A weighted undirected graph is a tuple , where
is the set of nodes, and
V x V
R+∪{0} is the edge weight function satisfying:
iff
. and
。
习题 2.1(习题9):考虑
, 重新写 Definition 7 以解决其存在的问题, 见其讨论 d).
Definition . A tree is a triple , where
is the set of nodes,
is the root, and
is the parent function satisfying:
a) , and
b) .
c) especially, when ,
is a speciall tree.
习题 3.1 模仿自动机的样子来重新定义二叉树.
A binary tree is a 5-tuple , where
a) is the alphabet, represents the left and right child node;
b) is the set of nodes ;
c) is the root of the tree;
d) is the set of terminal states;
e) f: is the transition function.
Any is accepted by this automata iff
and for the node that the path passes through, no node
appears twice.
习题3.2 模仿自动机的样子来重新定义树.
A tree is a 5-tuple , where
a) is the alphabet, represents the one child node;
b) is the set of nodes ;
c) is the root of the tree;
d) is the set of terminal states;
e) f: is the transition function.
Any is accepted by this automata iff
and for the node that the path passes through, no node
appears twice.