멤버가 개인 사정으로 스터디를 하지 못하게 되어서, 내가 오늘 진행을 하게 됐다. 내가 진행 할때와 안할때 조금은 다르게 공부를 한다. 덕분에 공부양도 많이 진다.


오늘 진행해야 할 내용은 기존 수치미분을 이용하여 손실 함수 값을 작게 한 것을 오류역전파법으로 바꾸어 수치미분으로 계산했던 것 보다 빠르게 계산하는 것을 코드로 구현하는 부분이다. 책을 보고 개념적으로 이해 안되는 부분은 데이터의 흐름을 보고 어렵지 않게 이해 하는 편이다. 현재 사용하는 툴이 주피터 노트북인데, 아직 한번도 이 툴로 디버깅을 해본적이 없다. 사실 파이썬 셀에서도 디버깅을 해보적이 없다. 디버깅은 파이참이나 비주얼코드로 편하게 했기 때문에, pbd를 이용한......


여튼...... 이 글을 시점에선 인터넷을 통해서 간단하게 배웠다. 파이썬 버전 3.7이상에서 내가 브레이크포인트를 넣고 싶은 곳에 breakpoint()만 써주면 된다. 마우스 클릭으로 디버깅을 했던것을 그냥 키보드로만 한다고 보면 된다. 아마도 프로그래밍 '프'짜도 모르는 사람이 본다면 멋져 보일 수도 있을거라 생각 된다. 디버깅을 하는 입장에서는 엄청 지루하고 노다가인데 말이다......


그냥 주피터 노트북에서 디버깅 하는 방법을 배웠단 거에 만족하고, 스터디에선 디버깅을 통한 설명을 하지 말아야 겠다. 하게 되면 지루해 질테니까......


옵티마이저 부분의 설명은 간단한거 같다. (SDG, 모멘텀, AdaGrad, Adam) 하지만 나중에 이것들 중에 하나를 선택해야 되는데, 선택 장애가 오지 않게 스터디 할때 집중해서 들어야 겠다.


이번 스터디를 하면서 정말 정말 정말 뼈저리게 느끼는게 있다. '학창 시절에 놀지 말고 수학 공부 열심히 할껄 ㅜㅜ'

뭐 그래도 열심히 하고 있으니, 이런 글을 쓰는거 같아 기분이 좋다^^.


다음글

이전글 2020/06/01 - [STUDY/딥러닝] - 딥러닝 온라인 스터디 벌써 1개월째~


반응형

'STUDY > 딥러닝' 카테고리의 다른 글

딥러닝 온라인 스터디 벌써 1개월째~  (0) 2020.06.01
블로그 이미지

두리뭉실:해피파인더그룹

컴퓨터 코치 두리뭉실

,

컴퓨터 프로그램

컴퓨터가 수행할 명령어를 적어 놓은 문서

어떤 문제를 해결하기 위해 컴퓨터에게 주어지는 처리 방법과 순서를 기술한 일련의 명령문 집합체

프로그래머

프로그램을 만드는 사람

IDLE

파이썬 코드를 작성하고 실행하고 저장하고 불러오는 것을 쉽게 해주는 것이 IDLE(Integrated Development and Learning Environment)다. 이 책의 코드를 작성하고 실행하는 것은 IDLE만으로도 충분할 것으로 생각 된다. 조금 인터넷을 검색해보면 '파이참' 또는 '주피터 노트북'이라는 통합개발환경 툴이 있다. 어느 것이든 한번쯤 사용해 보는걸 추천 하고, 툴 설치 사용에 서투르다면 나중에 해보길 바란다.

turtle

아마도 이 책을 혼자 공부를 한다면, 처음부터 막막할거 같다. 변수나 객체에 대한 얘기가 없기에 뭔지 모를거 같지만, 그냥 따라하면 된다. 어자피 앞으로 자세하게 배울테니까. 그리고 기존의 코드를 살짝 바꿔주고 결과가 어떻게 표시되는지 여러번 확인 하면, 정확하게는 아니더라도 대충은 어떻게 사용하는지는 알게 된다. 


1
2
3
4
5
6
7
>>> import turtle
>>> han = turtle.Turtle()
>>> han.shape('turtle')
>>> han.shape('turtle')
>>> han.forward(100)
>>> han.right(90)
>>> han.forward(100)
cs


이 코드를 하나씩 실행하게 되면 

화면이 하나 생기면서 

가운데 화살표가 표시 된다. 

그리고 화살표가 거북이로 변경 되고,

거북이가 보는 방향으로 100만큼 이동하면서 선이 그려진다.

그리고 시계방향으로 90도 거북이가 회전하고

거북이가 보는 방향으로 100만큼 이동하면서 선이 그려진다.


여러번 해본다면 어렵지 않게 자연스럽게  선을 그릴 수 있다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
>>> dir(turtle)
['Canvas''Pen''RawPen''RawTurtle''Screen''ScrolledCanvas''Shape''TK''TNavigator'
'TPen''Tbuffer''Terminator''Turtle''TurtleGraphicsError''TurtleScreen''TurtleScreenBase'
'Vec2D''_CFG''_LANGUAGE''_Root''_Screen''_TurtleImage''__all__''__builtins__''__cached__'
'__doc__''__file__''__forwardmethods''__func_body''__loader__''__methodDict''__methods'
'__name__''__package__''__spec__''__stringBody''_alias_list''_make_global_funcs'
'_screen_docrevise''_tg_classes''_tg_screen_functions''_tg_turtle_functions''_tg_utilities'
'_turtle_docrevise''_ver''addshape''back''backward''begin_fill''begin_poly''bgcolor''bgpic'
'bk''bye''circle''clear''clearscreen''clearstamp''clearstamps''clone''color''colormode'
'config_dict''deepcopy''degrees''delay''distance''done''dot''down''end_fill''end_poly'
'exitonclick''fd''fillcolor''filling''forward''get_poly''get_shapepoly''getcanvas'
'getmethparlist''getpen''getscreen''getshapes''getturtle''goto''heading''hideturtle''home'
'ht''inspect''isdown''isfile''isvisible''join''left''listen''lt''mainloop''math''mode'
'numinput''onclick''ondrag''onkey''onkeypress''onkeyrelease''onrelease''onscreenclick''ontimer'
'pd''pen''pencolor''pendown''pensize''penup''pos''position''pu''radians''read_docstrings'
'readconfig''register_shape''reset''resetscreen''resizemode''right''rt''screensize''seth'
'setheading''setpos''setposition''settiltangle''setundobuffer''setup''setworldcoordinates''setx'
'sety''shape''shapesize''shapetransform''shearfactor''showturtle''simpledialog''speed'
'split''st''stamp''sys''textinput''tilt''tiltangle''time''title''towards''tracer'
'turtles''turtlesize''types''undo''undobufferentries''up''update''width''window_height'
'window_width''write''write_docstringdict''xcor''ycor']
>>> dir(turtle.Turtle)
['DEFAULT_ANGLEOFFSET''DEFAULT_ANGLEORIENT''DEFAULT_MODE''START_ORIENTATION''__class__''__delattr__'
'__dict__''__dir__''__doc__''__eq__''__format__''__ge__''__getattribute__''__gt__''__hash__'
'__init__''__init_subclass__''__le__''__lt__''__module__''__ne__''__new__''__reduce__'
'__reduce_ex__''__repr__''__setattr__''__sizeof__''__str__''__subclasshook__''__weakref__'
'_cc''_clear''_clearstamp''_color''_colorstr''_delay''_drawturtle''_getshapepoly''_go'
'_goto''_newLine''_pen''_polytrafo''_reset''_rotate''_screen''_setDegreesPerAU''_setmode'
'_tracer''_undo''_undogoto''_update''_update_data''_write''back''backward''begin_fill''begin_poly'
'bk''circle''clear''clearstamp''clearstamps''clone''color''degrees''distance''dot''down'
'end_fill''end_poly''fd''fillcolor''filling''forward''get_poly''get_shapepoly''getpen''getscreen'
'getturtle''goto''heading''hideturtle''home''ht''isdown''isvisible''left''lt'
'onclick''ondrag''onrelease''pd''pen''pencolor''pendown''pensize''penup''pos''position'
'pu''radians''reset''resizemode''right''rt''screens''seth''setheading''setpos''setposition'
'settiltangle''setundobuffer''setx''sety''shape''shapesize''shapetransform''shearfactor''showturtle'
'speed''st''stamp''tilt''tiltangle''towards''turtlesize''undo''undobufferentries''up''width'
'write''xcor''ycor']
>>> help(turtle.Turtle.forward)
Help on function forward in module turtle:
 
forward(self, distance)
    Move the turtle forward by the specified distance.
    
    Aliases: forward | fd
    
    Argument:
    distance -- a number (integer or float)
    
    Move the turtle forward by the specified distance, in the direction
    the turtle is headed.
    
    Example (for a Turtle instance named turtle):
    >>> turtle.position()
    (0.000.00)
    >>> turtle.forward(25)
    >>> turtle.position()
    (25.00,0.00)
    >>> turtle.forward(-75)
    >>> turtle.position()
    (-50.00,0.00)
 
>>> help(han.forward)
Help on method forward in module turtle:
 
forward(distance) method of turtle.Turtle instance
    Move the turtle forward by the specified distance.
    
    Aliases: forward | fd
    
    Argument:
    distance -- a number (integer or float)
    
    Move the turtle forward by the specified distance, in the direction
    the turtle is headed.
    
    Example (for a Turtle instance named turtle):
    >>> turtle.position()
    (0.000.00)
    >>> turtle.forward(25)
    >>> turtle.position()
    (25.00,0.00)
    >>> turtle.forward(-75)
    >>> turtle.position()
    (-50.00,0.00)
 
>>> 
cs


help와 dir 내장함수를 이용하여 우리가 사용하는 것(?)에 대하여 정보를 얻을 수 있다.

반응형
블로그 이미지

두리뭉실:해피파인더그룹

컴퓨터 코치 두리뭉실

,