728x90
Deep Learning
52

Dive into Mojo🔥

Intermediate Representation (IR) Intermediate Representation (IR)은 사람이 이해하기 쉬운 High-level 언어에서 기계어와 유사한 Low-level 언어로 변환하는 중간 단계의 표현 방식을 의미한다. 컴파일러나 인터프리터는 프로그램을 High-level 언어에서 IR로 변환하고, 이후 IR을 다시 기계어로 변환하여 실행 가능한 형태로 만든다. Low-level IR Static Single Assignment (SSA) Form: 각 변수가 단 한 번만 정의되고 사용되는 형태로 변환하여 최적화를 용이하게 만듬 Three-Address Code: 각 명령어에 최대 세 개의 주소를 사용하는 형태로, 기계어에 가까운 표현 Control Flow Graph..

Deep Learning 2023.07.23

[Paper] VITRUVION: A GENERATIVE MODEL OF PARAMETRIC CAD SKETCHES (2)

Constraint Model constraint sequence의 autoregressive generation을 수행 $N_C$: constraint의 수 각 constraint는 (type, parameters)의 형태를 가지는 tuple을 가짐 2개 이하의 reference parameter를 가지는 모든 constraint를 다룸 (숫자 parameter 이거나 3개 이상의 reference를 가질 경우는 제외) Ordering constraint는 primitive에 따라 sorting된다. # https://github.com/PrincetonLIPS/vitruvion/blob/1b91fff5597b3a4e272e6490e4d458f3ef790e62/img2cad/constraint_data..

Deep Learning 2023.07.03

[Paper] VITRUVION: A GENERATIVE MODEL OF PARAMETRIC CAD SKETCHES (1)

Introduction 어떤 것을 설계할때 숫자 매개변수를 통해서 수정하게 되면 일관성있게 진행할 수 있다. 수정하면서 관련된 모든 것들을 수정하게되는데 이때 반복적인(중복된) 노력이 든다. 결국 이런 반복적인 일을 줄이고자하는 것이 목적인 것 같다. 엔지니어들은 가끔씩 위처럼 손으로 대충 그린 것을 자동으로 변환해주는 것을 원한다. (실제로 손으로 그리는 것은 많이 못 봤다... 진짜로 원하는 사람이 많은지는 모르겠다.) 해당 논문에서 소개하는 generate model인 Vitruvion은 autoregressive하게 constraint와 primitive를 sampling하여 일관성있는 CAD sketch를 만들어낸다. constraint graph를 통해 sketch를 생성할 수 있는 것은 자동..

Deep Learning 2023.06.25

외부 CAD Data로 SketchGraphs 데이터셋 생성 with python (3)

이전까지 외부 CAD Data를 FreeCAD로 불러와서 SketchGraphs 데이터로 만드는 것을 해보았다. 이제 만든 데이터를 SketchConcept 모델에 넣어서 결과를 확인해본다. Line 우선 이전에 Line의 pnt, dir, param을 구하는 방식이 잘못되어서 짚고 넘어간다. start_point = np.array([start_point.x, start_point.y]) end_point = np.array([end_point.x, end_point.y]) vec = end_point - start_point length = np.linalg.norm(vec) if length == 0: dirX, dirY = 1, 0 else: dirX, dirY = vec / length pntX..

Deep Learning 2023.06.16

외부 CAD Data로 SketchGraphs 데이터셋 생성 with python (2)

Previously 외부 CAD Data로 SketchGraphs 데이터셋 생성 with python (1) 에서는 FreeCAD를 사용하여 dxf에서 데이터를 뽑는 방법을 알아냈다. 이제 SketchGraphs데이터로 만들어봐야한다. SketchGraphs 우선 SketchGraphs의 sketch의 sequence는 NodeOp, EdgeOp라는 객체(class)로 이루어져있다. class NodeOp(typing.NamedTuple): """This class represents a node (or entity) operation in a construction sequence. An entity is specified by a label, along with a dictionary of param..

Deep Learning 2023.06.11

외부 CAD Data로 SketchGraphs 데이터셋 생성 with python (1)

SketchGraphs 논문, github 코드에는 Autoconstrain을 위한 모델이 존재한다. 그리고 constraint 정보를 포함한 데이터를 사용하여 Discovering Design Concepts for CAD Sketches 에서의 AutoCompletion을 수행할 수 있다. 그리고 이 모든 것은 Onshape 이라는 CAD 프로그램을 기준으로 만들어졌다. 따라서 다른 CAD 프로그램, 오픈소스 CAD를 사용하여 SketchGraphs 데이터셋을 만드는 것을 시작해보고자 한다. AutoCAD 우선 AutoCAD를 살펴보면 다음과 같이 constraint를 지정해줄 수 있다. 그리고 SketchGraphs에 Autoconstrain 모델이 따로 있는데 AutoCAD나 다른 CAD 프로그램..

Deep Learning 2023.06.04

Autoconstrain Model

Task Description partner prediction: 스케치의 노드와 constraints를 나타내는 그래프가 주어지면 새로운 constraint를 예측하기위해 현재 노드에 연결해야할 노드를 예측 constant lable prediction: partner prediction의 결과와 현재 constraint의 target partner가 주어지면 현재 constraint의 type을 예측 Model Description 모델은 다음 세 가지로 나누어진다. input representation: embedding the features from the primitives and constraints message passing: transforming these features using ..

Deep Learning 2023.05.24

[Paper] Discovering Design Concepts for CAD Sketches (4)

Cost matrix construction generated element와 target element와의 비교를 위해 type 차이를 계산 type과 parameter의 차이를 cross-entropy로 계산 reference의 binary distance 계산 Matching and reconstruction loss cost matrix C 가 주어지면 linear assignment를 적용 indices = [ linear_sum_assignment(c.detach().cpu()) for c in cost_matrixs] reference loss reference_loss = self.NLLloss(ref_pred_logprob, ref_dest_cand_idx) * self.correspon..

Deep Learning 2023.05.18
728x90