PyTorch×î¼Ñʵ¼ù£¬ÔõÑù²ÅÄÜд³öÒ»ÊÖ·ç¸ñÓÅÃÀµÄ´úÂë(4)
ʹÓÃÃüÁîÐвÎÊýÉèÖôúÂëÖ´ÐÐʱʹÓõIJÎÊý(batch µÄ´óС¡¢Ñ§Ï°ÂʵÈ)·Ç³£·½±ã¡£Ò»¸ö¼òµ¥µÄʵÑé²ÎÊý¸ú×Ù·½·¨£¬¼´Ö±½Ó°Ñ´Ó¡¸parse_args¡¹½ÓÊÕµ½µÄ×Öµä(dict Êý¾Ý)´òÓ¡³öÀ´£º
5. Èç¹û¿ÉÄܵĻ°£¬ÇëʹÓá¸Use .detach()¡¹´Ó¼ÆËãͼÖÐÊÍ·ÅÕÅÁ¿ ΪÁËʵÏÖ×Ô¶¯Î¢·Ö£¬PyTorch »á¸ú×ÙËùÓÐÉæ¼°ÕÅÁ¿µÄ²Ù×÷¡£ÇëʹÓá¸.detach()¡¹À´·ÀÖ¹¼Ç¼²»±ØÒªµÄ²Ù×÷¡£ 6. ʹÓá¸.item()¡¹´òÓ¡³ö±êÁ¿ÕÅÁ¿ Äã¿ÉÒÔÖ±½Ó´òÓ¡±äÁ¿¡£È»¶ø£¬ÎÒÃǽ¨ÒéÄãʹÓá¸variable.detach()¡¹»ò¡¸variable.item()¡¹¡£ÔÚÔçÆÚ°æ±¾µÄ PyTorch(< 0.4)ÖУ¬Äã±ØÐëʹÓá¸.data¡¹·ÃÎʱäÁ¿ÖеÄÕÅÁ¿Öµ¡£ 7. ʹÓá¸call¡¹·½·¨´úÌ桸nn.Module¡¹Öеġ¸forward¡¹·½·¨ ÕâÁ½ÖÖ·½Ê½²¢²»ÍêÈ«Ïàͬ£¬ÕýÈçÏÂÃæµÄ GitHub ÎÊÌâµ¥ËùÖ¸³öµÄ£º £¨±à¼£ºASPÕ¾³¤Íø£© |
- ËÑË÷ÒýÇæ¶Ô×ÔÖúÁ´½ÓÓÐ
- ¸öÈËÍøÕ¾ÈçºÎ·¢Õ¹µÄ¼¸
- ÍøÕ¾Ö÷»ú½Ì³Ì(7):ÍøÕ¾
- ÍøÕ¾Ö÷»ú½Ì³Ì(5):Ö÷»ú
- postgresql SQLÓï¾ä±ä
- ·ÀÖ¹ÍøÕ¾±»ºÚ¿Í¹¥»÷µÄ×î¼Ñʵ¼ù£ºÕ¾³¤µÄ°²È«Ö¸
- ÍøÕ¾Óû§ÌåÑéÓÅ»¯Êµ¼ù£ºÕ¾³¤µÄÓû§ÎªÖÐÐÄÉè¼Æ
- É罻ýÌåÓªÏú²ßÂÔʵ¼ù£ºÕ¾³¤µÄ»¥¶¯ÓªÏú·¨
- ÍøÕ¾ÏìӦʽÉè¼Æʵ¼ù£ºÕ¾³¤µÄÉè¼ÆÕÜѧ
- ËÑË÷ÒýÇæÓÅ»¯£¨SEO£©£ºÕ¾³¤µÄ×î¼Ñ²ßÂÔ
- ÔÚÎïÁªÍøÉ豸Öб£»¤±à³Ì½Å±¾µÄ×î¼Ñʵ¼ù
- ÔÚÔÆ»·¾³Öб£»¤±à³Ì½Å±¾µÄ×î¼Ñʵ¼ù
- ±à³Ì½Å±¾¼ÓÃܵÄ×î¼Ñʵ¼ù£º°²È«±àÂëµÄÒÕÊõ