8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

更新QListWidget以添加用户输入

juanpa.arrivillaga 7月前

29 0
我将自定义列表项目添加到qlistwidget。 自定义列表项目具有qformlayout,我最初添加标题和一个加载gif。 当脚本需要输入时,函数'create_input_form'a ...

我将自定义列表项目添加到qlistwidget。

自定义列表项目具有qformlayout,我最初添加标题和一个加载gif。 当脚本需要输入时,函数'create_input_form'将新行添加到表单布局中,包括Qlable,qlineedit和两个qpushbuttons(确定和取消)。 然后,我尝试在qlistwidget中获取用户输入,因为该表单现在具有输入选项。

我的问题是,仅在将所有列表项添加到qlistwidget之后,添加到表单布局中的输入部分才会添加,因此新的输入部分位于现有列表项目后面。

当我需要在mainwindow类中输入时,我会调用create_input_form。

我正在做的事情的功能是工作,这只是我调用create_input_form之后更新QListWidget的问题,然后在一个按钮被clcked clcked和form Bleeout中的一个行之后删除 >

是否有一种方法可以使Qlistwidget刷新。

我尝试了RepAlt()和update(),但也许我做得不正确。

这是CustomListItem类

class CustomListItem(QWidget):

    def __init__(
            self, 
            item_id):
        super().__init__()
        self.item_id = item_id # Unique identifier for the list item
        self.input_script_name = ""
        self.input_script_request = ""
        
        # # Create base layout
        self.layout_base = QVBoxLayout(self)
        
        
        self.layout_script = QHBoxLayout()
                


        
        self.layout_form = QFormLayout()
        
        self.scriptLabel = QLabel(self.script_name)
        
        self.layout_script.addWidget(self.scriptLabel)
        

        # Placeholder for a progress icon or additional status label
        self.statusLabel = QLabel(self)
        movie = QMovie(os.path.abspath(u"./Images/loadgif(1).gif"))
        
        self.statusLabel.setMovie(movie)
        movie.start()
        
        
        # add label and status label to HBox
        self.layout_script.addWidget(self.statusLabel)
        
        # add HBox to form 
        self.layout_form.addRow(self.layout_script)
        
        self.layout_base.addLayout(self.layout_form)
        
        self.setLayout(self.layout_base)
    
    # Definition to create a user input under the relevant script list item when that list item requires input
    def create_input_form(self, input_script_request):

        self.input_script_request = input_script_request
        
        
        # Input fields
        self.scriptInputRequest = QLabel(self.input_script_request)
        
        self.scriptInputField = QLineEdit() # create line edit for user input
        
        # Create a lineedit based on whether the input is for a password or not
        if 'password' in self.input_script_request:
            self.scriptInputField.setEchoMode(QLineEdit.Password)   # set echomode to password

        # add label and status label to form row
        self.layout_form.addRow(self.scriptInputRequest)
        self.layout_form.addRow(self.scriptInputField)
        
        # Buttons
        self.okButton = QPushButton("Ok")   # create ok button
        self.cancelButton = QPushButton("Cancel")   # create cancel button
        self.okButton.setFixedWidth(100)
        self.cancelButton.setFixedWidth(100)
        # add buttons to form row
        self.layout_form.addRow(self.okButton, self.cancelButton)
        
        # On clicked methods connect
        self.okButton.clicked.connect(self.ok_clicked)
        self.cancelButton.clicked.connect(self.cancel_clicked)
        
                

        
    
    # Called when ok button is clicked
    def ok_clicked(self):
        self.layout_form.removeRow(3)
        self.layout_form.removeRow(2)
        self.layout_form.removeRow(1)
        
        
    # Called when cancel button is clicked
    def cancel_clicked(self):
        
        self.layout_form.removeRow(3)
        self.layout_form.removeRow(2)
        self.layout_form.removeRow(1)

这是GUI输出:

“

帖子版权声明 1、本帖标题: 更新QListWidget以添加用户输入
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由juanpa.arrivillaga在本站《python》版块原创发布, 转载请注明出处!
最新回复 (0)
  • 请修剪您的代码,以便更轻松地找到您的问题。 遵循以下准则来创建一个
  • 试图刮擦网站时,他们无法在我的页面变量索引中找到文本。 分页的Len()显示了正确的数字,因此我知道它找到了我想要的元素。n ...

    尝试刮擦网站时,他们无法在我的页面索引中找到文本。

    分页的Len()显示了正确的数字,因此我知道它找到了我想要的元素。 如果有人可以帮助我,我会很感激。
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.action_chains import ActionChains
    from selenium.webdriver.chrome.options import Options # ALLOWS PROGRAM TO RUN W/O WINDOW OPENING
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    
    
    import pandas as pd
    import time
    # THESE TURN ON HEADLESS MODE
    options = Options()
    options.add_argument("--headless=new")
    options.add_argument("window-size=1920x1080")
    
    # THESE ACCESS THE WEBSITE AND PULL DATA
    web = "https://www.audible.com/adblbestsellers?page=1&ref_pageloadid=vungFE9JcaT4XEUq&ref=a_adblbests_c5_pageNum_0&pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&pf_rd_r=CTE7EBFZPGVW9C9MJYWQ&pageLoadId=ViHKKYBoSP03JQKv&creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170"
    driver = webdriver.Chrome(options= options)
    driver.get(web)
    # driver.maximize_window()
    
    # PAGINATION
    pagination = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH,'.//ul[contains(@class, "pagingElements")]')))
    # pagination = driver.find_element(By.XPATH,'.//ul[contains(@class, "pagingElements")]')
    pages = WebDriverWait(pagination, 20).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR,'a.pageNumberElement')))
    #pages = pagination.find_elements(By.XPATH,'.//ul[contains(@class,"pagingElements")]/li')
    last_page = int(pages[1].text)
    
    current_page = 1
    
    while current_page <= last_page:
        
        # time.sleep(2)
        # FINDING ELEMENTS W/ WAITS AND CONDITIONS
        container = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.CLASS_NAME, 'adbl-impression-container')))
        products = WebDriverWait(container, 5).until(EC.presence_of_all_elements_located((By.XPATH, './/li[contains(@class, "productListItem")]')))
       
    
        book_title = []
        book_author = []
        book_length = []
    
        for product in products:
    
            book_title.append(product.find_element(By.XPATH,".//h3[contains(@class, 'bc-heading')]").text)
            book_author.append(product.find_element(By.XPATH,".//li[contains(@class, 'authorLabel')]").text)
            book_length.append(product.find_element(By.XPATH,".//li[contains(@class, 'runtimeLabel')]").text) 
    
        current_page = current_page + 1
        
        try:
            next_page = driver.find_element(By.XPATH, './/span[contains(@class, "nextButton")]')
            driver.implicitly_wait(10)
            ActionChains(driver).move_to_element(next_page).click(next_page).perform()
        except:
            print("Nope")
        
        
    df_books = pd.DataFrame({'title': book_title, 'author': book_author, 'length': book_length})
    df_books.to_csv('pagination.csv', index=False)
    
    driver.quit()
    
    

    追溯(最近的最新通话): 文件“ C:\ users \ rluck \ oneDrive \ desktop \ deftracted_content \ my_apps \ my_apps \ filter \ program.py”,第18行,in last_page = int(页[-2] .Text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^因为 valueerror:base 10的int()的文字无效:''

    我尝试通过XPATH,ClassName,TagName和CSS选择器定位。

    我试图从索引中获取文本,以指示何时应该打破时段。

    当我进行一些调试时,它向我展示了我要寻找的文字,但否则我无法得到。

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    
    import pandas as pd
    
    web = "https://www.audible.com/adblbestsellers?ref_pageloadid=not_applicable&ref=a_search_t1_navTop_pl0cg1c0r0&pf_rd_p=334a4a9c-12d2-4c3f-aee6-ae0cbc6a1eb0&pf_rd_r=XG7ESF49MWSMHKFW027S&pageLoadId=0IuRVXnX3DGs76JX&creativeId=7ba42fdf-1145-4990-b754-d2de428ba482"
    driver = webdriver.Chrome()
    driver.get(web)
    
    pagination = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH, './/ul[contains(@class, "pagingElements")]')))
    
    # Print the HTML content of the pagination element
    print(pagination.get_attribute("outerHTML"))
    
    pages = WebDriverWait(pagination, 20).until(EC.presence_of_all_elements_located((By.TAG_NAME, 'li')))
    
    # Print the HTML content of each page element
    for i, page in enumerate(pages):
        print(f"Page {i + 1} HTML={repr(page.get_attribute('outerHTML'))} text={repr(page.text)}")
    
    # Extract the last page number
    last_page = int(pages[-2].text) if pages and pages[-2].text.isdigit() else 1
    
    print("Last Page:", last_page)
    '''
    <li class="bc-list-item">
        <a class="bc-link
        refinementFormLink pageNumberElement
    
        bc-color-link" tabindex="0" href="/adblbestsellers?page=5&amp;ref_pageloadid=0IuRVXnX3DGs76JX&amp;ref=a_adblbests_c5_pageNum_3&amp;pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&amp;pf_rd_r=RGEY6R11PSFH96HYBZZ1&amp;pageLoadId=7wau2qFrQbdrOLQh&amp;creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170">5</a>
    </li>
    
    Page 1 HTML='<li class="bc-list-item">\n    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n\n  \n  \n  \n  \n  \n  \n\n\n\n  \n    \n  \n  \n\n\n\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n  \n    \n    <span class="bc-button\n  bc-button-secondary\n  previousButton  \n  \n  \n  bc-button-small \n  bc-button-inline \n  bc-button-disabled">\n  
        <a class="bc-button-text" aria-disabled="true" href="/adblbestsellers?page=0&amp;ref_pageloadid=0IuRVXnX3DGs76JX&amp;ref=a_adblbests_c5_pageBack&amp;pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&amp;pf_rd_r=RGEY6R11PSFH96HYBZZ1&amp;pageLoadId=7wau2qFrQbdrOLQh&amp;creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170" tabindex="0" role="button">\n        <span class="bc-text\n    bc-button-text-inner \n    bc-size-action-small">\n    \n    \n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\t\n\n\n\n\n\n\n\n\n<i 
    aria-hidden="true" class="bc-icon\n\tbc-icon-fill-base\n\tbc-icon-chevron-left-s2\n\t\n\tbc-icon-chevron-left \n\t\n\tbc-color-base">\n</i>\n \n\n  \n<span class="bc-text\n    bc-pub-offscreen">Go back a page</span>\n  </span>\n      </a>\n    </span>\n  \n\n  \n\n  \n\n  \n\n\n</li>' text='Go back a page'
    Page 2 HTML='<li class="bc-list-item">\n    \n \n\n  \n<span class="bc-text\n    pageNumberElement">1</span>\n</li>' text='1'
    Page 3 HTML='<li class="bc-list-item">\n    <a class="bc-link\n    refinementFormLink pageNumberElement \n    \n    bc-color-link" tabindex="0" href="/adblbestsellers?page=2&amp;ref_pageloadid=0IuRVXnX3DGs76JX&amp;ref=a_adblbests_c5_pageNum_1&amp;pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&amp;pf_rd_r=RGEY6R11PSFH96HYBZZ1&amp;pageLoadId=7wau2qFrQbdrOLQh&amp;creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170">2</a>\n</li>' text='2'
    Page 4 HTML='<li class="bc-list-item">\n    \n \n\n  \n<span class="bc-text\n    pageNumberElement">...</span>\n</li>' text=''
    Page 5 HTML='<li class="bc-list-item">\n    <a class="bc-link\n    refinementFormLink pageNumberElement \n    \n    bc-color-link" tabindex="0" href="/adblbestsellers?page=5&amp;ref_pageloadid=0IuRVXnX3DGs76JX&amp;ref=a_adblbests_c5_pageNum_3&amp;pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&amp;pf_rd_r=RGEY6R11PSFH96HYBZZ1&amp;pageLoadId=7wau2qFrQbdrOLQh&amp;creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170">5</a>\n</li>' text=''
    Page 6 HTML='<li class="bc-list-item">\n    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n\n  \n  \n  \n  \n  \n  \n\n\n\n  \n    \n  \n  \n\n\n\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n  \n    \n    <span class="bc-button\n  bc-button-secondary\n  nextButton refinementFormButton \n  \n  \n  bc-button-small \n  bc-button-inline">\n      <a 
    class="bc-button-text" href="/adblbestsellers?page=2&amp;ref_pageloadid=0IuRVXnX3DGs76JX&amp;ref=a_adblbests_c5_pageNext&amp;pf_rd_p=3c1c017b-585f-4bde-98c6-e3cb784e4b8e&amp;pf_rd_r=RGEY6R11PSFH96HYBZZ1&amp;pageLoadId=7wau2qFrQbdrOLQh&amp;creativeId=0bf0e03f-bb55-481b-b4fd-d67375977170" tabindex="0" role="button">\n        <span class="bc-text\n    bc-button-text-inner \n    bc-size-action-small">\n    \n    \n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\t\n\n\n\n\n\n\n\n\n<i aria-hidden="true" class="bc-icon\n\tbc-icon-fill-base\n\tbc-icon-chevron-right-s2\n\t\n\tbc-icon-chevron-right \n\t\n\tbc-color-base">\n</i>\n \n\n  \n<span class="bc-text\n    bc-pub-offscreen">Go forward a page</span>\n  </span>\n      </a>\n    </span>\n  \n\n  \n\n  \n\n  \n\n\n</li>' text=''
    Last Page: 1
    '''
    I'm trying to pull the "5" that's on HTML Page 5
    
  • Mark 7月前 0 只看Ta
    引用 4
    向我们展示您的调试输出。 也显示两者
  • 编辑以显示复制形式。 也许文字被隐藏了
  • 该应用程序在一系列框中输入信息。 最后,该信息用于启动由调度程序管理的许多过程。 一旦开始过程,Progress Sho ...

    该应用程序将用户输入一系列框中的信息。

    最后,该信息用于启动由调度程序管理的许多过程。 一旦开始过程,应通过状态框的连续更新向用户显示进度。

    用户将同时运行该应用程序的多个实例。

    用户应该能够制作应用程序的新实例,并查看所有先前具有正在进行过程的实例的状态框。

    当前方法(使用 多处理 为操作稳定性添加)实际上如下:

    import toga
    import multiprocessing
    from toga.style import Pack
    
    
    class Test(toga.App):
        
        instances = []
        
        def startup(self):
    
            self.main_box = toga.Box(style=Pack(direction='column'))        
    
            self.main_window = toga.MainWindow(title=self.formal_name)
            
            self.main_window.content = self.main_box
            
            self.main_window.show()
            
            self.work()
            
        
        def work(self):
            
            add_but = toga.Button('Add instance to list', on_press=self.add_but_hdl)
            
            ins_num = len(Test.instances) + 1
            
            ins_lbl = toga.Label('Current instance number is {}'.format(ins_num))
            
            if Test.instances:
                prv_ins_idx = len(Test.instances) - 1
                self.main_box.add(Test.instances[prv_ins_idx].main_window.show(),
                                  ins_lbl, 
                                  add_but)
            else:
                self.main_box.add(ins_lbl, add_but)
                
                
        def add_but_hdl(self, widget):
            
            Test.instances.append(self)
            
            self.init_proc()
            
            
        def init_proc(self):
            
            proc = multiprocessing.Process(target=self.mk_app_ins)
            
            proc.start()
            
            
        def mk_app_ins(self):
            
            new_ins = Test()
            
            new_ins.main_loop()
    
    
    def main():
            
        return Test()
    

    通过 公文包dev 并按下 添加实例 时,以上会导致错误:

    [招标]从开发模式开始... =============================================== ======================= 未能注册:一个对象已经导出针对...

    的接口org.gtk.application。

    是否可以使设置工作,还是应该忽略它以采用完全不同的方法?

    可行的解决方案会是什么样?
  • GTK期望每个实例具有唯一的ID,但是在您的设置中,每个过程都试图创建一个具有相同标识符的新应用程序。
  • 我为用Python编写的窗口分发了一个现成的软件: 运送Python嵌入式版本的内容,例如Python-3.8.10-Embed-Amd64.zip 添加一个myprogram \ package文件夹...

    我分发了用python编写的窗口的现成的软件:

    • 运送Python嵌入式版本的内容,Say Python-3.8.10-embed-Amd64.zip
    • 添加 myProgram \ 软件包文件夹(=程序本身)
    • 简单地运行 pythonw.exe -m myprogram 启动程序

    它运行良好(并且是CXFreeze and Co的简单替代品,但此部分在这里是不可能的)。

    树结构是:

    main\
        _asyncio.pyd
        _bz2.pyd
        ... + other .pyd files
        libcrypto-1_1.dll
        ... + other .dll files
        python.exe
        pythonw.exe    
        python38._pth
        python38.zip
        ...
        myprogram\     # here my main program as a module
        PIL\           # dependencies
        win32\
        numpy\
        ...            # many other folders for dependencies
    

    是否有一种方法可以将所有依赖项文件夹移至子文件夹,并且仍然可以找到Python(嵌入式版本)?

    如何这样做? 这样,这样:
    main\
        python.exe
        pythonw.exe    
        python38._pth
        python38.zip
        ...
        myprogram\     # here my main program as a module
        dependencies\
           PIL\         # all required modules 
           win32\
           numpy\
           ...      
           _asyncio.pyd   # and also .pyd files
           ...          
    

    nb:目标是在这里使用嵌入式python,这是完全独立的 与系统的全局python安装。

    因此,这与 pythonpath等任何环境变量都独立
  • 不,目的是在这里使用嵌入式python,这完全独立于用户的全局python安装。 因此,%appdata%\ python \ ...在这里不可能。
  • pts 7月前 0 只看Ta
    引用 10
    请参阅我编辑的问题结尾处的注释。
  • 我的答复的主要内容仍然有效。 您可以将这些依赖项放在您喜欢的任何文件夹中。
  • 不,这在此特定上下文@mudskipper中不起作用:“嵌入式Python”安装具有定位依赖关系的规则,完全独立于PythonPath或其他环境变量。
  • 您有参考吗?
  • 引用 14
    我正在尝试训练LSTM模型,然后进行完全连接的层,以对具有22个通道(序列长度为1000)的一组EEG时间序列数据进行分类。 我正在使用Pytorch ...

    我正在尝试训练LSTM模型,然后是完全连接的层,以对一组EEG时间序列数据进行分类,该数据具有22个通道(序列长度为1000)。

    我正在使用pytorch进行层,但是在训练期间,验证准确性并不能提高。 如果有的话,验证变得更糟。 我假设这里有很多过度适应的事情,但是我很困惑为什么它仍然与随机选择班级相同的水平(我有4个类)。 有人知道为什么这样吗? 我正在附加用于创建模型,训练它的代码以及培训期间的一些输出。

    代码

    num_layers = 1
    input_size = 22
    hidden_size = 32
    num_classes = 4
    batch_size = 50
    num_epochs = 20
    
    class LSTMClassifier(nn.Module):
      def __init__(self, input_size, hidden_size, num_classes):
          super(LSTMClassifier, self).__init__()
          self.hidden_size = hidden_size
          self.lstm = nn.LSTM(input_size, hidden_size, batch_first=True, dropout=0.5, num_layers=num_layers)
          self.fc = nn.Linear(hidden_size, num_classes)
    
      def forward(self, x):
          # Set initial hidden and cell states
          h0 = torch.zeros(num_layers, x.size(0), self.hidden_size).to(x.device)
          c0 = torch.zeros(num_layers, x.size(0), self.hidden_size).to(x.device)
    
          # Forward propagate LSTM
          out, _ = self.lstm(x, (h0, c0))
    
          # Decode the hidden state of the last time step
          out = self.fc(out[:, -1, :])
          return out
    
    
    # Instantiate the model
    model = LSTMClassifier(input_size, hidden_size, num_classes)
    model.to(device)
    
    # Define loss function and optimizer
    criterion = nn.CrossEntropyLoss()
    optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
    
    # Training loop
    for epoch in range(num_epochs):
        model.train()
        total_loss, correct, total = 0.0, 0, 0
    
        for i in range(0, len(X_train), batch_size):
            optimizer.zero_grad()
    
            # Get batch data
            batch_input = X_train[i:i+batch_size, :, :input_size]  # Ensure input size matches
            batch_target = y_train[i:i+batch_size]
    
            # Forward pass
            outputs = model(batch_input)
    
            # Calculate loss
            loss = criterion(outputs, batch_target)
    
            # Backward pass and optimize
            loss.backward()
            optimizer.step()
            total_loss += loss.item()
    
            # Calculate accuracy
            _, predicted = torch.max(outputs, 1)
            total += batch_target.size(0)
            correct += (predicted == batch_target).sum().item()
    
        accuracy = 100 * correct / total
        # Validation
        model.eval()
        total_loss_valid, correct_valid, total_valid = 0.0, 0, 0
    
        with torch.no_grad():
          outputs = model(X_valid)
          loss_valid = criterion(outputs, y_valid)
          total_loss_valid += loss_valid.item()
    
          _, predicted_valid = torch.max(outputs, 1)
          total_valid += y_valid.size(0)
          correct_valid += (predicted_valid == y_valid).sum().item()
    
        accuracy_valid = 100 * correct_valid / total_valid
    
        print("Epoch:", epoch+1, "\t\tTraining Loss:", total_loss, "\tTraining Accuracy:", accuracy)
        print("\t\t\tValidation Loss:", total_loss_valid, "\tValidation Accuracy:", accuracy_valid)
    
    print("Model training complete.")
    

    训练输出

    Epoch: 1        Training Loss: 47.797505140304565   Training Accuracy: 24.231678486997637
                Validation Loss: 1.3961728811264038     Validation Accuracy: 23.87706855791962
    Epoch: 2        Training Loss: 46.88989615440369    Training Accuracy: 27.77777777777778
                Validation Loss: 1.3933675289154053     Validation Accuracy: 24.34988179669031
    Epoch: 3        Training Loss: 46.60832667350769    Training Accuracy: 30.61465721040189
                Validation Loss: 1.3946889638900757     Validation Accuracy: 28.368794326241133
    Epoch: 4        Training Loss: 46.370394468307495   Training Accuracy: 31.85579196217494
                Validation Loss: 1.3951939344406128     Validation Accuracy: 27.89598108747045
    Epoch: 5        Training Loss: 46.11502695083618    Training Accuracy: 34.1016548463357
                Validation Loss: 1.3980598449707031     Validation Accuracy: 27.659574468085108
    Epoch: 6        Training Loss: 45.86429834365845    Training Accuracy: 35.579196217494086
                Validation Loss: 1.399003267288208  Validation Accuracy: 26.24113475177305
    Epoch: 7        Training Loss: 45.610363483428955   Training Accuracy: 37.35224586288416
                Validation Loss: 1.4000375270843506     Validation Accuracy: 24.34988179669031
    Epoch: 8        Training Loss: 45.35917508602142    Training Accuracy: 37.70685579196218
                Validation Loss: 1.4008349180221558     Validation Accuracy: 26.24113475177305
    Epoch: 9        Training Loss: 45.06815278530121    Training Accuracy: 39.657210401891255
                Validation Loss: 1.4022436141967773     Validation Accuracy: 25.29550827423168
    Epoch: 10       Training Loss: 44.72212290763855    Training Accuracy: 41.016548463356976
                Validation Loss: 1.4047679901123047     Validation Accuracy: 23.87706855791962
    Epoch: 11       Training Loss: 44.39665925502777    Training Accuracy: 41.78486997635934
                Validation Loss: 1.4072729349136353     Validation Accuracy: 25.768321513002363
    Epoch: 12       Training Loss: 44.04106819629669    Training Accuracy: 42.434988179669034
                Validation Loss: 1.409785509109497  Validation Accuracy: 24.34988179669031
    Epoch: 13       Training Loss: 43.70037293434143    Training Accuracy: 43.73522458628842
                Validation Loss: 1.4153059720993042     Validation Accuracy: 25.059101654846337
    Epoch: 14       Training Loss: 43.31694221496582    Training Accuracy: 45.62647754137116
                Validation Loss: 1.4185421466827393     Validation Accuracy: 23.87706855791962
    Epoch: 15       Training Loss: 42.95249891281128    Training Accuracy: 46.74940898345154
                Validation Loss: 1.425550937652588  Validation Accuracy: 24.58628841607565
    Epoch: 16       Training Loss: 42.523557305336  Training Accuracy: 47.75413711583924
                Validation Loss: 1.4291025400161743     Validation Accuracy: 24.113475177304963
    Epoch: 17       Training Loss: 42.142807960510254   Training Accuracy: 48.758865248226954
                Validation Loss: 1.4345715045928955     Validation Accuracy: 24.822695035460992
    Epoch: 18       Training Loss: 41.72265028953552    Training Accuracy: 49.645390070921984
                Validation Loss: 1.4420568943023682     Validation Accuracy: 24.34988179669031
    Epoch: 19       Training Loss: 41.276421666145325   Training Accuracy: 50.354609929078016
                Validation Loss: 1.449327826499939  Validation Accuracy: 25.53191489361702
    Epoch: 20       Training Loss: 40.81519865989685    Training Accuracy: 51.59574468085106
                Validation Loss: 1.4553029537200928     Validation Accuracy: 25.29550827423168
    Model training complete.
    
返回
作者最近主题: