Deep Learning: Diffusion Models - Part 2
IntroThe goal of diffusion models is: while you have a lot of images and you want to have more, you can use images you have as training data, and a diffusion model, which is a neural network, serves as the generator.
In order to make images useful to a neural network, we need to train the network waht these images are about, including fine details, general outlines and everything in between. One way to do that is adding different noise levels to the training data. During the noising process, bo ...
Java: Class
Creating Classes
打开左侧的 Project 面板
右击 main class 的商机文件夹,选择 New -> Java Class
命名时每个单词的首字母大写
1234567891011public class TextBox { public String text = ""; public void setText(String text) { this.text = text; } public void clear() { text = ""; }}
Creating Objects123456789public class Main { public static void main(String[] args) {// TextBox textBox1 = new TextBox(); var textBox1 = new TextBox ...
Java: Debugging and Packaging Applications
Types of Errors
Compile-time Errors: 语法错误导致的错误,编译器能检测到
Run-time Errors: 逻辑错误等,用 Debugger 来检测
Debugging
在命令行前点击增加断点(或 Run -> ViewBreakpoints 或 快捷键 command + shift + F8)
Debug 运行(Control + D)
调用栈
Packaging构建一个 Java 程序后,若想分享给别人使用, 需要将代码打包进一个 jar 文件中,jar 是 Java Archive 的简称,他是一个包文件形式,包含用于分享的所有代码。
构建方式:
File -> Project Structure -> Artifacts -> + -> JAR -> From modules with dependencies
选择 Main Class
OK and OK
Build -> Build Artifacts
选择 Build,Rebuild 或者 Clean,第一次选择 Build
在代码左侧 ...
Java: Clean Coding
Creating Methods1234567891011public class Main { public static void main(String[] args) { String message = greetUser("Lucas", "YE"); System.out.println(message); } public static String greetUser(String firstName, String lastName){ return "Hello " + firstName + " " + lastName; }}
Extracting Methords改变代码的结构却不改变它的行为
12345678910111213141516171819202122232425262728293031323334353637383940public clas ...
Java: Control Flow
Comparison Operators
>
\<
\=
>=
\<=
Logical Operators
&&
||
!
Conditional StatementsIf12345678910111213public class Main { public static void main(String[] args) { int temp = 32; if (temp > 30) { System.out.println("Il fait chaud!"); } else if (temp >20) { System.out.println("Il fait bon!"); } else { System.out.println("Il fait froid!"); } ...